diff --git a/pyproject.toml b/pyproject.toml index a8f9258..0712e1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ pytest-cov = "^4.1.0" enable = true [tool.pytest.ini_options] -addopts = "--capture=no --cov --cov-report term --cov-report xml" +addopts = "--capture=no" [tool.ruff] line-length = 88 diff --git a/pytest_ruff.py b/pytest_ruff.py index c78900e..ffa8456 100644 --- a/pytest_ruff.py +++ b/pytest_ruff.py @@ -65,6 +65,7 @@ def collect(self): collection.append(RuffFormatItem.from_parent(self, name="ruff::format")) return [Item.from_parent(self, name=Item.name) for Item in collection] + def check_file(path): ruff = find_ruff_bin() command = [ruff, "check", path, "--quiet", "--show-source", "--force-exclude"] diff --git a/tox.ini b/tox.ini index 8e06f37..f16d762 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,21 @@ [tox] isolated_build = true -envlist = py{38,39,310,311,312} +envlist = py{38,39,310,311,312},lint [testenv] allowlist_externals = poetry commands = poetry install --no-root --with dev - poetry run pytest -vvv {posargs} + # Disable ruff plugin to generate better coverage results + poetry run pytest -p no:ruff -vvv --cov --cov-append --cov-report term --cov-report xml {posargs} [testenv:lint] description = lint source code deps = ruff commands = - ruff check . - ruff format . + ruff check --extend-exclude=tests/assets/ . + ruff format --check --exclude=tests/assets/ . [gh-actions] python = @@ -22,4 +23,4 @@ python = 3.9: py39 3.10: py310 3.11: py311 - 3.12: py312 + 3.12: py312,lint