From 06bd56cb122f499bddebf0b2691a32a46688ec17 Mon Sep 17 00:00:00 2001 From: Lars Date: Wed, 21 Feb 2024 21:12:57 +0100 Subject: [PATCH] Switched from flake8 to ruff as linter --- .github/workflows/ci.yml | 5 ++--- noxfile.py | 7 +++---- pyproject.toml | 4 ++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcc86487..a43c6a15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: run: | sudo apt -y install libzbar0 pip install -r tests/requirements.txt - pip install flake8 + pip install ruff pip install mypy - name: Run tests run: | @@ -32,6 +32,5 @@ jobs: - name: Run lint tests if: ${{ matrix.python-version == '3.12' }} run: | - flake8 segno - flake8 tests/ + ruff . mypy segno diff --git a/noxfile.py b/noxfile.py index e78427c2..1d081d51 100644 --- a/noxfile.py +++ b/noxfile.py @@ -71,12 +71,11 @@ def coverage(session): @nox.session(python=_PY_DEFAULT_VERSION) def lint(session): """\ - Run flake8 + Run linters. """ - session.install('flake8', 'mypy') + session.install('ruff', 'mypy') session.run('mypy', 'segno') - session.run('flake8', 'segno') - session.run('flake8', 'tests') + session.run('ruff', '.') @nox.session(python=_PY_DEFAULT_VERSION) diff --git a/pyproject.toml b/pyproject.toml index a97923d2..a3a4c50b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,3 +65,7 @@ exclude = [".github", ".*", "sandbox/*"] [tool.flit.external-data] directory = "data" + +[tool.ruff] +exclude = ['examples'] +