-
Notifications
You must be signed in to change notification settings - Fork 36
51 lines (43 loc) · 1.3 KB
/
code-checks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: "code checks"
on: push
jobs:
code-checks:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: init venv
run: .devcontainer/bin/init_venv.sh
- name: check Python imports
run: >
.venv/bin/isort . --check --diff
--skip .venv
--skip .mnist-keras
--skip .mnist-pytorch
--skip fedn_pb2.py
--skip fedn_pb2_grpc.py
- name: check Python formatting
run: >
.venv/bin/autopep8 --recursive --diff
--exclude .venv
--exclude .mnist-keras
--exclude .mnist-pytorch
--exclude fedn_pb2.py
--exclude fedn_pb2_grpc.py
.
- name: run Python linter
run: >
.venv/bin/flake8 .
--exclude ".venv,.mnist-keras,.mnist-pytorch,fedn_pb2.py,fedn_pb2_grpc.py"
- name: check for floating imports
run: >
! grep -E -R
--exclude-dir='.venv'
--exclude-dir='.mnist-pytorch'
--exclude-dir='.mnist-keras'
--exclude-dir='docs'
--exclude-dir='flower-client'
--exclude='tests.py'
--exclude='README.rst'
'^[ \t]+(import|from) ' -I .
# TODO: add linting/formatting for all file types