Skip to content

Commit 49680bc

Browse files
committed
refactor: improve flake8 configuration and workflow
- Add comprehensive .flake8 configuration file - Exclude site-packages and non-project directories - Update flake8 workflow step to only check project files - Add clear error reporting in CI workflow - Set standard Python code style settings
1 parent 7029dbd commit 49680bc

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

.flake8

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[flake8]
2+
# Exclude patterns for directories and files
3+
exclude =
4+
.venv/*,
5+
.git/*,
6+
__pycache__/*,
7+
build/*,
8+
dist/*,
9+
*.pyc,
10+
*.egg-info,
11+
.eggs/*,
12+
.tox/*,
13+
.pytest_cache/*,
14+
venv/*,
15+
env/*,
16+
*/site-packages/*,
17+
allure-report/*,
18+
allure-results/*,
19+
htmlcov/*
20+
21+
# Maximum line length
22+
max-line-length = 120
23+
24+
# Ignore specific errors/warnings:
25+
# E226: Missing whitespace around arithmetic operator
26+
# W503: Line break occurred before binary operator (conflicts with W504)
27+
ignore = E226, W503

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@ jobs:
8080
run: |
8181
source .venv/bin/activate
8282
pip install flake8
83-
# Stop the build if there are Python syntax errors or undefined names
84-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
85-
# Exit-zero treats all errors as warnings
86-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
83+
84+
# First check for critical errors (syntax errors and undefined names)
85+
echo "Checking for critical errors..."
86+
flake8 utils/ tests/ conftest.py setup.sh validate_workflow.py \
87+
--count --select=E9,F63,F7,F82 --show-source --statistics
88+
89+
# Then run full lint check on project files
90+
echo "Running full lint check..."
91+
flake8 utils/ tests/ conftest.py setup.sh validate_workflow.py \
92+
--count --statistics
8793
8894
- name: Run smoke tests
8995
run: |

0 commit comments

Comments
 (0)