Skip to content

Commit f7f9a8d

Browse files
committed
move static code analysis to Github actions
1 parent 803a712 commit f7f9a8d

File tree

4 files changed

+41
-18
lines changed

4 files changed

+41
-18
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,45 @@ jobs:
3939
with:
4040
fail_ci_if_error: true
4141

42+
static-code-analysis:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v2
46+
- name: Set up Python
47+
uses: actions/setup-python@v2
48+
with:
49+
python-version: "3.10"
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install -e .
54+
pip install -r requirements-lint.txt
55+
- name: mypy 3.7
56+
continue-on-error: true
57+
run: |
58+
mypy --python-version 3.7 .
59+
- name: mypy 3.8
60+
continue-on-error: true
61+
run: |
62+
mypy --python-version 3.8 .
63+
- name: mypy 3.9
64+
continue-on-error: true
65+
run: |
66+
mypy --python-version 3.9 .
67+
- name: mypy 3.10
68+
continue-on-error: true
69+
run: |
70+
mypy --python-version 3.10 .
71+
- name: pylint
72+
continue-on-error: true
73+
run: |
74+
pylint --rcfile=.pylintrc \
75+
can/**.py \
76+
setup.py \
77+
doc.conf \
78+
scripts/**.py \
79+
examples/**.py
80+
4281
format:
4382
runs-on: ubuntu-latest
4483
steps:

.travis.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,6 @@ jobs:
7474
# -a Write all files
7575
# -n nitpicky
7676
- python -m sphinx -an doc build
77-
- stage: linter
78-
name: "Linter Checks"
79-
python: "3.9"
80-
before_install:
81-
- travis_retry pip install -r requirements-lint.txt
82-
script:
83-
# -------------
84-
# pylint checking:
85-
# check the entire main codebase (except the tests)
86-
- pylint --rcfile=.pylintrc can/**.py setup.py doc.conf scripts/**.py examples/**.py
87-
# -------------
88-
# mypy checking:
89-
- mypy
90-
can/*.py
91-
can/io/**.py
92-
scripts/**.py
93-
examples/**.py
9477
- stage: deploy
9578
name: "PyPi Deployment"
9679
python: "3.9"

requirements-lint.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ pylint==2.12.2
22
black==21.12b0
33
mypy==0.931
44
mypy-extensions==0.4.3
5+
types-setuptools

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
license_file = LICENSE.txt
33

44
[mypy]
5-
python_version = 3.7
65
warn_return_any = True
76
warn_unused_configs = True
87
ignore_missing_imports = True
98
no_implicit_optional = True
109
disallow_incomplete_defs = True
1110
warn_redundant_casts = True
1211
warn_unused_ignores = True
12+
exclude = (^venv|^test|^can/interfaces|^setup.py$)

0 commit comments

Comments
 (0)