Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ruff for formatting too #645

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'
# Note the order is intentional to avoid multiple passes of the hooks
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
rev: v0.4.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes, --unsafe-fixes]
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,5 @@ inline-quotes = "single"
forced-separate = ["conftest"]
force-single-line = true

[tool.black]
line-length = 140
target-version = ["py38"]
skip-string-normalization = true
[tool.ruff.format]
quote-style = "preserve"
1 change: 0 additions & 1 deletion src/pytest_cov/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ class DistWorker(CovController):

@_ensure_topdir
def start(self):

cleanup()

# Determine whether we are collocated with master.
Expand Down
2 changes: 0 additions & 2 deletions src/pytest_cov/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def __init__(self, options, pluginmanager, start=True, no_cov_should_warn=False)
# worker is started in pytest hook

def start(self, controller_cls, config=None, nodeid=None):

if config is None:
# fake config option for engine
class Config:
Expand Down Expand Up @@ -339,7 +338,6 @@ def pytest_runtestloop(self, session):
self.cov_controller.finish()

if not self._is_worker(session) and self._should_report():

# import coverage lazily here to avoid importing
# it for unit tests that don't need it
from coverage.misc import CoverageException
Expand Down
Loading