Skip to content

Commit 97e4ff8

Browse files
committed
Add flake8 CI
1 parent c49afcb commit 97e4ff8

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.flake8

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[flake8]
2+
ignore=
3+
#E124 closing bracket does not match visual indentation
4+
E124,
5+
#E127 continuation line over-indented for visual indent
6+
E127,
7+
#E128 continuation line under-indented for visual indent
8+
E128,
9+
#E201 whitespace after
10+
E201,
11+
#E202 whitespace before
12+
E202,
13+
#E203 whitespace before
14+
E203,
15+
#E221 multiple spaces before operator
16+
E221,
17+
#E222 multiple spaces after operator
18+
E222,
19+
#E251 unexpected spaces around keyword / parameter equals
20+
E251,
21+
#E271 multiple spaces after keyword
22+
E271,
23+
#E501 line too long
24+
E501,
25+
#E123 closing bracket does not match indentation of opening bracket's line
26+
E123,
27+
#E126 continuation line over-indented for hanging indent
28+
E126,
29+
#W503 line break before binary operator [PEP8 recomments this style]
30+
W503

.github/workflows/flake8.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check code with flake8
2+
3+
on:
4+
pull_request:
5+
branches: [ main, develop ]
6+
7+
jobs:
8+
flake8:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set conda package directory
14+
run: |
15+
mkdir /tmp/condapkgs
16+
echo "CONDA_PKGS_DIRS=/tmp/condapkgs" >> $GITHUB_ENV
17+
- name: Set up Python 3.8
18+
run: |
19+
$CONDA/bin/conda create -p /tmp/condaenv python=='3.8.*' flake8
20+
- name: Activate conda environment
21+
run: |
22+
echo "/tmp/condaenv/bin" >> $GITHUB_PATH
23+
export PATH="/tmp/condaenv/bin:$PATH"
24+
- name: Run flake8
25+
run: |
26+
flake8

0 commit comments

Comments
 (0)