Skip to content

Commit ec491c5

Browse files
authored
Merge pull request #807 from ftnext/refactor/add-makefile
refactor: Use pipx for lint and rstcheck
2 parents f7e3545 + 3f9403b commit ec491c5

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ on:
99
- master
1010

1111
jobs:
12-
flake8:
12+
lint:
1313
runs-on: ubuntu-latest
1414

1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Run flake8
18-
run: |
19-
# ignore errors for long lines and multi-statement lines
20-
pipx run flake8 --ignore=E501,E701,W503 .
18+
run: make lint

.github/workflows/rstcheck.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,5 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.11'
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install rstcheck
2317
- name: Run rstcheck
24-
run: |
25-
python -m rstcheck --ignore-directives autofunction README.rst reference/*.rst
18+
run: make rstcheck

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lint:
2+
# ignore errors for long lines and multi-statement lines
3+
@pipx run flake8 --ignore=E501,E701,W503 .
4+
5+
rstcheck:
6+
@pipx run rstcheck --ignore-directives autofunction README.rst reference/*.rst

README.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ Releases are done by running ``make-release.sh VERSION_GOES_HERE`` to build the
296296
Testing
297297
~~~~~~~
298298

299+
Prerequisite: `Install pipx <https://pipx.pypa.io/stable/installation/>`__.
300+
299301
To run all the tests:
300302

301303
.. code:: bash
@@ -306,13 +308,13 @@ To run static analysis:
306308

307309
.. code:: bash
308310
309-
python -m flake8 --ignore=E501,E701,W503 speech_recognition tests examples setup.py
311+
make lint
310312
311313
To ensure RST is well-formed:
312314

313315
.. code:: bash
314316
315-
python -m rstcheck README.rst reference/*.rst
317+
make rstcheck
316318
317319
Testing is also done automatically by GitHub Actions, upon every push.
318320

setup.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[options.extras_require]
22
dev =
3-
flake8
4-
rstcheck
53
pytest
64
pytest-randomly
75
respx

0 commit comments

Comments
 (0)