Skip to content

Commit ba08258

Browse files
committed
aligned dev setup with github action
1 parent 9349f77 commit ba08258

3 files changed

Lines changed: 293 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ dev = [
6262
"pre-commit>=4.3.0",
6363
"black>=25.12.0",
6464
"python-dotenv>=1.0.0",
65-
"sharepoint-to-text==0.8.1"
65+
"sharepoint-to-text==0.8.1",
66+
"pycln>=2.6.0",
67+
"isort>=7.0.0",
68+
"flake8>=7.3.0",
69+
"PyYAML>=6.0.0"
6670
]
6771

6872
[tool.black]

0 commit comments

Comments
 (0)