Skip to content

Commit 17be15c

Browse files
ci(fix): fix linting configuration to exclude virtual environments
- Add .flake8 configuration - Update CI workflow to exclude .venv from checks - Add exclusion patterns to Black and isort configurations
1 parent 0685e62 commit 17be15c

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
exclude = .git,__pycache__,build,dist,.venv,venv
3+
max-line-length = 88
4+
max-complexity = 10
5+
ignore = E203, W503 # These conflict with black
6+
per-file-ignores =
7+
# imported but unused in __init__ files
8+
__init__.py: F401

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040

4141
- name: Lint with flake8
4242
run: |
43-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
44-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
43+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.venv,.git,__pycache__,build,dist
44+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics --exclude=.venv,.git,__pycache__,build,dist
4545
4646
- name: Format check with black
47-
run: poetry run black --check .
47+
run: poetry run black --check --exclude=\.venv .
4848

4949
- name: Import sorting check with isort
50-
run: poetry run isort --check .
50+
run: poetry run isort --check --skip .venv .
5151

5252
- name: Test with pytest
5353
run: poetry run pytest --cov=src

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ major_on_zero = false
4949
line-length = 88
5050
target-version = ["py312"]
5151
include = '\.pyi?$'
52+
exclude = '''
53+
/(
54+
\.git
55+
| \.venv
56+
| __pycache__
57+
| build
58+
| dist
59+
)/
60+
'''
5261

5362
[tool.isort]
5463
profile = "black"
55-
line_length = 88
64+
line_length = 88
65+
skip = [".venv", ".git", "__pycache__", "build", "dist"]

0 commit comments

Comments
 (0)