-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.18 KB
/
lint.yml
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
name: Linter
on:
push:
paths:
- "**.py"
- ".github/workflows/lint.yml"
pull_request:
branches: [main]
paths:
- "**.py"
- ".github/workflows/lint.yml"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
cache: "pip"
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 colorama isort
- name: Lint using flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./src/ninjar --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 ./src/ninjar --count --max-complexity=10 --max-line-length=120 --statistics
- name: Lint using isort
run: |
isort --check-only --show-files --color --profile black src/ninjar