Repository navigation
71 lines (58 loc) · 2.13 KB
/
Copy pathpython-lint.yaml
File metadata and controls
71 lines (58 loc) · 2.13 KB
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
name: Python Code Quality and Lint
on:
push:
branches: [ master ]
paths:
- 'wikibaseintegrator/**.py'
- 'test/**.py'
- 'scripts/**.py'
- 'pyproject.toml'
- 'poetry.lock'
- '.github/workflows/python-lint.yaml'
pull_request:
branches: [ '**' ]
paths:
- 'wikibaseintegrator/**.py'
- 'test/**.py'
- 'scripts/**.py'
- 'pyproject.toml'
- 'poetry.lock'
- '.github/workflows/python-lint.yaml'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.14
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.14'
cache: 'poetry'
# Need to install poetry again in the new python version
- name: Install poetry
run: python -m pip install poetry
- name: Install dependencies
run: |
python -m poetry install --with dev
- name: isort imports check
run: |
python -m poetry run isort --check --diff wikibaseintegrator test scripts
- name: mypy typing check
run: |
python -m poetry run mypy --install-types --non-interactive
- name: pylint code linting
# Errors and warnings fail the build, conventions and refactoring suggestions are only reported. In the tests, the
# pytest fixtures make redefined-outer-name and unused-argument false positives, and testing private helpers is fine.
run: |
python -m poetry run pylint --fail-under=0 --fail-on=E,W,F wikibaseintegrator scripts
python -m poetry run pylint --fail-under=0 --fail-on=E,W,F --disable=redefined-outer-name,unused-argument,protected-access test
- name: codespell spell checking
run: |
python -m poetry run codespell wikibaseintegrator test scripts
- name: flynt string formatter converting
run: |
python -m poetry run flynt -f wikibaseintegrator test scripts