Skip to content

Commit acfcf63

Browse files
committed
Lint Python code during CI run (#33)
Use flake8 to check: - Formatting compliance with PEP 8 - Code style consistency - Cyclomatic complexity A configuration file is provided to assist contributors with verifying compliance locally.
1 parent d1cc99c commit acfcf63

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
doctests = True
3+
# W503 and W504 are mutually exclusive. PEP 8 recommends line break before.
4+
ignore = W503
5+
max-complexity = 10
6+
max-line-length = 120
7+
select = E,W,F,C,N

.github/workflows/libraries_report-size-deltas.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
with:
1616
python-version: '3.8.2'
1717

18+
- name: Lint with flake8
19+
run: |
20+
pip install --quiet flake8
21+
pip install --quiet pep8-naming
22+
flake8 --show-source "$GITHUB_WORKSPACE/libraries/report-size-deltas"
23+
1824
- name: Run Python unit tests
1925
run: |
2026
export PYTHONPATH="$GITHUB_WORKSPACE/libraries/report-size-deltas"

0 commit comments

Comments
 (0)