From 734e48015bddea7d93825646457eb0ef810ca88d Mon Sep 17 00:00:00 2001 From: Nick Stenning Date: Sun, 6 Oct 2024 14:34:43 +0200 Subject: [PATCH] Switch to ruff for linting --- .github/workflows/main.yml | 2 ++ pyproject.toml | 4 ++++ tox.ini | 15 ++++----------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69395e6..121b558 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,6 +57,8 @@ jobs: - uses: hynek/setup-cached-uv@v2 - name: Run tox + env: + RUFF_OUTPUT_FORMAT: github run: > uvx --with=tox-uv --with=tox-gh-actions tox run --installpkg dist/*.whl diff --git a/pyproject.toml b/pyproject.toml index 56b8c53..6ec0691 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,10 @@ supervisord = "honcho.export.supervisord:Export" systemd = "honcho.export.systemd:Export" upstart = "honcho.export.upstart:Export" +[tool.ruff] +format.exclude = ["honcho/_version.py"] +lint.select = ["E4", "E7", "E9", "F", "I", "N", "RUF"] + [tool.setuptools.packages.find] where = ["."] include = ["honcho*"] diff --git a/tox.ini b/tox.ini index ade893f..5daa6c9 100644 --- a/tox.ini +++ b/tox.ini @@ -6,10 +6,6 @@ [tox] envlist = py38, py39, py310, py311, py312, py313, pypy39, pypy310, lint -[flake8] -max-line-length = 110 -exclude = .tox,.git,doc - [pytest] minversion = 2.8 testpaths = tests @@ -41,16 +37,13 @@ commands = coverage erase [testenv:coverage] deps = coverage skip_install = true -commands = - coverage report +commands = coverage report [testenv:lint] -deps = - flake8 - pep8-naming +passenv = RUFF_OUTPUT_FORMAT +deps = ruff skip_install = true -commands = - flake8 honcho +commands = ruff check {posargs} [testenv:docs] extras = docs