-
Notifications
You must be signed in to change notification settings - Fork 8
97 lines (93 loc) · 2.99 KB
/
linters.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Linters (Code Style Checks)
on:
pull_request:
push:
branches:
- master
jobs:
isort:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install isort
run: |
python -m pip install -r requirements/extras.txt
python -m pip install colorama
- name: Retrieve isort version
run: |
ISORTVERSION=$(python -c "import isort; print(isort.__version__)")
echo "ISORT_VERSION=${ISORTVERSION}" >> $GITHUB_ENV
- name: Which isort version
uses: isort/isort-action@v1.1.0
with:
isort-version: "${{ env.ISORT_VERSION }}"
configuration: "--version"
- name: Run isort checks
uses: isort/isort-action@v1.1.0
with:
isort-version: "${{ env.ISORT_VERSION }}"
configuration: "--check-only --diff --color"
black:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install black
run: |
python -m pip install -r requirements/extras.txt
- name: Retrieve black version
run: |
BLACKVERSION=$(python -c "import black; print(black.__version__)")
echo "BLACK_VERSION=${BLACKVERSION}" >> $GITHUB_ENV
- name: Which black version
uses: psf/black@stable
with:
version: "${{ env.BLACK_VERSION }}"
options: "--version"
- name: Run black checks
uses: psf/black@stable
with:
version: "${{ env.BLACK_VERSION }}"
options: "--check --diff --color"
codespell:
name: codespell
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
python -m pip install --progress-bar off pip --upgrade
python -m pip install --progress-bar off -r requirements/extras.txt
- name: Codespell README
run: |
echo
echo "Codespell finds typos in source code. Rather than checking if each word"
echo "matches a dictionary entry, it looks for a set of common misspellings"
echo "in order to reduce the number of false positives."
echo
echo "After codespell has been installed locally ('pip install codespell'),"
echo "running the command 'codespell -i 2 -w' will interactively go through"
echo "misspellings and suggest one or more replacements. Add any false"
echo "positives under ignore-words-list under [codespell] in setup.cfg."
echo
- name: Run test
run: |
codespell .