@@ -50,11 +50,60 @@ jobs:
5050 run : |
5151 uv sync --all-groups
5252
53- - name : Run black
53+ - name : Run trailing-whitespace
54+ run : |
55+ # Check for trailing whitespace
56+ if git grep -n '[[:space:]]$' -- '*.py' '*.yml' '*.yaml' '*.md' '*.txt' '*.json' '*.toml'; then
57+ echo "Error: Found trailing whitespace in files"
58+ exit 1
59+ fi
60+ echo "No trailing whitespace found"
61+
62+ - name : Run end-of-file-fixer
63+ run : |
64+ # Check for missing newline at end of files
65+ for file in $(git ls-files -- '*.py' '*.yml' '*.yaml' '*.md' '*.txt' '*.json' '*.toml'); do
66+ if [ -s "$file" ] && [ "$(tail -c 1 "$file" | wc -l)" -eq 0 ]; then
67+ echo "Error: Missing newline at end of $file"
68+ exit 1
69+ fi
70+ done
71+ echo "All files end with proper newlines"
72+
73+ - name : Run check-yaml
74+ run : |
75+ # Check YAML syntax
76+ for file in $(git ls-files -- '*.yml' '*.yaml'); do
77+ python -c "import yaml; yaml.safe_load(open('$file'))" || {
78+ echo "Error: Invalid YAML syntax in $file"
79+ exit 1
80+ }
81+ done
82+ echo "All YAML files are valid"
83+
84+ - name : Run check-merge-conflict
85+ run : |
86+ # Check for merge conflict markers
87+ if git grep -n '^<<<<<<< ' -- '*.py' '*.yml' '*.yaml' '*.md' '*.txt' '*.json' '*.toml'; then
88+ echo "Error: Found merge conflict markers"
89+ exit 1
90+ fi
91+ echo "No merge conflict markers found"
92+
93+ - name : Run pycln (remove unused imports)
94+ run : |
95+ uv pip install pycln
96+ uv run pycln --all --check odf_decrypt
97+
98+ - name : Run isort (import sorting)
99+ run : |
100+ uv pip install isort
101+ uv run isort --profile black --check-only odf_decrypt
102+
103+ - name : Run black (code formatting)
54104 run : |
55105 uv run black --check .
56106
57- - name : Run flake8
107+ - name : Run flake8 (linting)
58108 run : |
59- uv pip install flake8
60- uv run flake8 odf_decrypt --ignore=E203,E501
109+ uv run flake8 odf_decrypt --extend-ignore=E203,E501
0 commit comments