Skip to content

Commit 354f8c6

Browse files
committed
MAINT: Define lint as own process
This way the lint step is only run once, rather than for every possible combination of environments that is currently tested.
1 parent f681ec3 commit 354f8c6

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/lint.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read # to fetch code (actions/checkout)
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test_lint:
17+
name: Lint
18+
# If using act to run CI locally the github object does not exist and the usual skipping should not be enforced
19+
if: "github.repository == 'scipy/scipy' || github.repository == ''"
20+
runs-on: ubuntu-22.04
21+
strategy:
22+
matrix:
23+
python-version: ['3.11']
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
submodules: recursive
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install Python packages
37+
run: |
38+
python -m pip install --upgrade pip poetry
39+
poetry env use ${{ matrix.python-version }}
40+
poetry install --with=test --with=lint
41+
42+
- name: Lint with flake8
43+
run: |
44+
set -euo pipefail
45+
# stop the build if there are Python syntax errors or undefined names
46+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
47+
# The GitHub editor is 127 chars wide
48+
poetry run flake8 . --ignore=F401,F403,W503,E226 --count --max-complexity=10 --max-line-length=127 --statistics

0 commit comments

Comments
 (0)