Skip to content

Commit

Permalink
lint: use python helper to point to the ruff bin (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo authored Nov 15, 2024
1 parent 18a17f1 commit d7e8b5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytest_examples/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from black import format_str as black_format_str
from black.output import diff as black_diff
from ruff.__main__ import find_ruff_bin

from .config import ExamplesConfig

Expand Down Expand Up @@ -47,7 +48,8 @@ def ruff_check(
*,
extra_ruff_args: tuple[str, ...] = (),
) -> str:
args = 'ruff', 'check', '-', *config.ruff_config(), *extra_ruff_args
ruff = find_ruff_bin()
args = ruff, 'check', '-', *config.ruff_config(), *extra_ruff_args

p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)
stdout, stderr = p.communicate(example.source, timeout=10)
Expand Down

0 comments on commit d7e8b5f

Please sign in to comment.