Skip to content

Commit

Permalink
Update code to pass latest ruff (remove noqa and use new features of …
Browse files Browse the repository at this point in the history
…some libs).
  • Loading branch information
jatkinson1000 committed Oct 26, 2024
1 parent ebea0e8 commit 0222059
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion archeryutils/classifications/tests/test_agb_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class TestCalculateAgbFieldClassification:
),
],
)
def test_calculate_agb_field_classification( # noqa: PLR0913 Too many arguments
def test_calculate_agb_field_classification(
self,
roundname: str,
score: float,
Expand Down
4 changes: 2 additions & 2 deletions archeryutils/classifications/tests/test_agb_outdoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class TestCalculateAgbOutdoorClassification:
),
],
)
def test_calculate_agb_outdoor_classification( # noqa: PLR0913 Too many arguments
def test_calculate_agb_outdoor_classification(
self,
score: float,
roundname: str,
Expand Down Expand Up @@ -482,7 +482,7 @@ def test_calculate_agb_outdoor_classification( # noqa: PLR0913 Too many argumen
),
],
)
def test_calculate_agb_outdoor_classification_prestige_dist( # noqa: PLR0913 Too many arguments
def test_calculate_agb_outdoor_classification_prestige_dist(
self,
score: float,
roundname: str,
Expand Down
3 changes: 1 addition & 2 deletions archeryutils/handicaps/tests/test_handicaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def test_handicap_scheme_subclass_generation(
hcclass: HandicapScheme,
) -> None:
"""Check that appropriate subclasses are generated by handicap_scheme()."""
# Comparison to type as mypy doesn't like mixing isinstance() & user-defined cls
assert type(hc.handicap_scheme(scheme)) == hcclass
assert type(hc.handicap_scheme(scheme)) == hcclass # noqa: E721 Comparison to type as mypy doesn't like mixing isinstance() & user-defined cls


class TestSigmaT:
Expand Down
4 changes: 2 additions & 2 deletions archeryutils/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, n_arrows: int, target: Target) -> None:
raise TypeError(msg)

@classmethod
def at_target( # noqa: PLR0913
def at_target(
cls,
n_arrows: int,
scoring_system: ScoringSystem,
Expand Down Expand Up @@ -195,7 +195,7 @@ class Round:
"""

def __init__( # noqa: PLR0913
def __init__(
self,
name: str,
passes: Iterable[Pass],
Expand Down
4 changes: 2 additions & 2 deletions archeryutils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def _get_sys_info() -> list: # pragma: no cover
# get full commit hash
commit = None
if os.path.isdir(".git") and os.path.isdir("archeryutils"):
with subprocess.Popen(
'git log --format="%H" -n 1'.split(" "), # noqa: S603 subprocess call this is safe
with subprocess.Popen( # noqa: S603 subprocess call this is safe
'git log --format="%H" -n 1'.split(" "),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
) as pipe:
Expand Down

0 comments on commit 0222059

Please sign in to comment.