Skip to content

Commit 4feafea

Browse files
committed
Add linting GHA
1 parent bba4d69 commit 4feafea

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/lint.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Code Style
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: "Lint Code Base"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Python 3.10
14+
uses: actions/setup-python@v5
15+
with:
16+
# change this to a version matrix
17+
python-version: 3.10
18+
19+
- name: Install and configure Poetry
20+
uses: snok/install-poetry@v1
21+
with:
22+
version: 1.8.3
23+
virtualenvs-create: true
24+
25+
- name: Install dependencies
26+
run: |
27+
poetry install --only dev --no-root --no-interaction
28+
29+
- name: Lint with flake8
30+
run: |
31+
# stop the build if there are Python syntax errors or undefined names
32+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
33+
poetry run flake8 . --count --max-complexity=10 --max-line-length=88 --statistics
34+
35+
- name: Check with black
36+
run: |
37+
poetry run black . --check --diff
38+
39+
- name: Run GitHub super-linter
40+
uses: github/super-linter/slim@v6
41+
env:
42+
DEFAULT_BRANCH: master
43+
# To report GitHub Actions status checks
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
VALIDATE_ALL_CODEBASE: true
46+
VALIDATE_YAML: true
47+
VALIDATE_JSON: true
48+
VALIDATE_MD: true
49+
VALIDATE_BASH: true
50+
VALIDATE_DOCKER: true
51+
VALIDATE_ENV: true

0 commit comments

Comments
 (0)