Skip to content

Commit 91d8172

Browse files
authored
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 1daf8f9 commit 91d8172

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/libraries_compile-examples.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
python -m pip install --upgrade pip
2121
pip install --requirement "$GITHUB_WORKSPACE/libraries/compile-examples/reportsizetrends/requirements.txt"
2222
23+
- name: Lint with flake8
24+
run: |
25+
pip install --quiet flake8
26+
pip install --quiet pep8-naming
27+
flake8 --show-source "$GITHUB_WORKSPACE/libraries/compile-examples/reportsizetrends"
28+
2329
- name: Run Python unit tests
2430
run: |
2531
export PYTHONPATH="$GITHUB_WORKSPACE/libraries/compile-examples/reportsizetrends"

reportsizetrends/.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
doctests = True
3+
max-complexity = 10
4+
max-line-length = 120
5+
select = E,W,F,C,N

0 commit comments

Comments
 (0)