Skip to content

Commit 203377e

Browse files
authored
Replace flake8, bugbear, isort, and pyupgrade with ruff (#568)
1 parent 8884064 commit 203377e

23 files changed

+124
-61
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8-

.github/workflows/build.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
schedule:
77
- cron: '0 4 * * 1'
88
jobs:
9+
ruff: # https://beta.ruff.rs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- run: pip install --user ruff
14+
- run: ruff --format=github .
15+
916
# this job ensures that tests can run from the packaged version, which means
1017
# that nose2 is correctly packaging and distributing its tests
1118
test-sdist:
@@ -27,6 +34,7 @@ jobs:
2734
nose2 -v --pretty-assert
2835
2936
test:
37+
needs: ruff
3038
strategy:
3139
fail-fast: false
3240
matrix:

.pre-commit-config.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@ repos:
33
rev: v4.4.0
44
hooks:
55
- id: check-merge-conflict
6+
- id: check-toml
7+
- id: check-yaml
8+
- id: end-of-file-fixer
69
- id: trailing-whitespace
710
- repo: https://github.com/python-jsonschema/check-jsonschema
811
rev: 0.22.0
912
hooks:
1013
- id: check-github-workflows
1114
- id: check-dependabot
1215
- id: check-readthedocs
13-
- repo: https://github.com/asottile/pyupgrade
14-
rev: v3.3.1
15-
hooks:
16-
- id: pyupgrade
17-
args: ["--py36-plus"]
1816
- repo: https://github.com/psf/black
1917
rev: 23.3.0
2018
hooks:
2119
- id: black
2220
language_version: python3
23-
- repo: https://github.com/PyCQA/flake8
24-
rev: 6.0.0
25-
hooks:
26-
- id: flake8
27-
language_version: python3
28-
additional_dependencies: ['flake8-bugbear==22.7.1']
29-
- repo: https://github.com/PyCQA/isort
30-
rev: 5.12.0
31-
hooks:
32-
- id: isort
33-
language_version: python3
34-
types: [python]
3521
- repo: https://github.com/codespell-project/codespell
3622
rev: v2.2.4
3723
hooks:
3824
- id: codespell
25+
additional_dependencies:
26+
- tomli
27+
- repo: https://github.com/charliermarsh/ruff-pre-commit
28+
rev: v0.0.261
29+
hooks:
30+
- id: ruff
31+
- repo: https://github.com/abravalheri/validate-pyproject
32+
rev: v0.12.2
33+
hooks:
34+
- id: validate-pyproject
35+
- repo: https://github.com/tox-dev/pyproject-fmt
36+
rev: 0.9.2
37+
hooks:
38+
- id: pyproject-fmt

contributing.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ You can also use ``make test`` and ``make lint`` for these.
4242
Linting
4343
+++++++
4444

45-
nose2 uses `black`_, `isort`_, and `flake8`_ to enforce linting and code
46-
style rules, and `pre-commit`_ to run these tools.
45+
nose2 uses `black`_ and `ruff`_ to enforce code formatting and linting and
46+
`pre-commit`_ to run these tools.
4747

4848
For the best development experience, we recommend setting up integrations with
4949
your editor and git.
@@ -59,9 +59,8 @@ have ``pre-commit`` installed and run:
5959
If you need to bypass pre-commit hooks after setting this up, you can commit
6060
with ``--no-verify``
6161

62-
.. _github: https://github.com/nose-devs/nose2
63-
.. _tox: http://pypi.python.org/pypi/tox
6462
.. _black: https://black.readthedocs.io/
65-
.. _isort: https://pycqa.github.io/isort/
66-
.. _flake8: https://flake8.pycqa.org/
63+
.. _github: https://github.com/nose-devs/nose2
6764
.. _pre-commit: https://pre-commit.com/
65+
.. _ruff: https://beta.ruff.rs/docs/
66+
.. _tox: http://pypi.python.org/pypi/tox

docs/decorators.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Setup & Teardown
88
================
99

1010
.. autofunction :: nose2.tools.decorators.with_setup
11-
.. autofunction :: nose2.tools.decorators.with_teardown
11+
.. autofunction :: nose2.tools.decorators.with_teardown

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
.. include :: ../README.rst
44
.. include :: contents.rst.inc
5-

docs/plugins/collect.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ Collecting tests without running them
33
=====================================
44

55
.. autoplugin :: nose2.plugins.collect.CollectOnly
6-

docs/plugins/doctests.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ Loader: Doctests
33
================
44

55
.. autoplugin :: nose2.plugins.doctests.DocTestLoader
6-
7-

docs/plugins/functions.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ Loader: Test Functions
33
======================
44

55
.. autoplugin :: nose2.plugins.loader.functions.Functions
6-

docs/plugins/junitxml.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,3 @@ The XML test report for nose2's sample scenario with tests in a package looks li
8888
</failure>
8989
</testcase>
9090
</testsuite>
91-

0 commit comments

Comments
 (0)