Skip to content

Commit da0a769

Browse files
authored
Create lint_python.yml
Initial commit
1 parent 541c677 commit da0a769

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/lint_python.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This is a basic workflow to help get any Python project started.
2+
name: lint_python
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the "main" branch
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
lint_python:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v4
19+
- run: pip install --upgrade pip wheel
20+
- run: pip install bandit black codespell flake8 flake8-bugbear
21+
flake8-comprehensions isort mypy pytest pyupgrade safety
22+
- run: bandit --recursive --skip B404,B602,B605 .
23+
- run: black --check . || true
24+
- run: codespell --ignore-words-list="fo,seh"
25+
- run: flake8 --ignore=B001,B007,C408,E111,E127,E203,E261,E265,E303,E402,E701,E711,E722,F401,F541,F841,W291,W293
26+
--max-complexity=32 --max-line-length=118 --show-source --statistics .
27+
- run: isort --check-only --profile black . || true
28+
- run: pip install -r requirements.txt
29+
- run: mkdir --parents --verbose .mypy_cache
30+
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
31+
- run: pytest . || pytest --doctest-modules . || true
32+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
33+
- run: safety check

0 commit comments

Comments
 (0)