Skip to content

Commit

Permalink
chore(ruff): add pygrep lint group (#1505)
Browse files Browse the repository at this point in the history
* add 'pygrep' lint group

* fixup
  • Loading branch information
danieleades authored Feb 11, 2024
1 parent ece7c9c commit 74bba54
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion copier/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def printf(
if not style:
return action + _msg

out = style + [action] + Style.RESET + [INDENT, _msg] # type: ignore
out = style + [action] + Style.RESET + [INDENT, _msg] # type: ignore[operator]
print(*out, sep="", file=file_)
return None # HACK: Satisfy MyPy

Expand Down
2 changes: 1 addition & 1 deletion devtasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def lint(recycle_container=False):
try:
local["nix"].with_cwd(HERE)[args] & TEE
except CommandNotFound:
_logger.warn("Nix not found; fallback to a container")
_logger.warning("Nix not found; fallback to a container")
runner = local.get("podman", "docker")
try:
(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ style = "pep440"
vcs = "git"

[tool.ruff.lint]
extend-select = ["B", "D", "E", "F", "I", "UP"]
extend-select = ["B", "D", "E", "F", "I", "PGH", "UP"]
extend-ignore = ['B028', "B904", "D105", "D107", "E501"]

[tool.ruff.lint.per-file-ignores]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ def test_value_with_forward_slash(tmp_path_factory: pytest.TempPathFactory) -> N
({"type": "str"}, True, does_not_raise()),
({"type": "str"}, False, does_not_raise()),
({"type": "str"}, Decimal(1.1), does_not_raise()),
({"type": "str"}, Enum("A", ["a", "b"], type=str).a, does_not_raise()), # type: ignore
({"type": "str"}, Enum("A", ["a", "b"]).a, pytest.raises(ValueError)), # type: ignore
({"type": "str"}, Enum("A", ["a", "b"], type=str).a, does_not_raise()), # type: ignore[attr-defined]
({"type": "str"}, Enum("A", ["a", "b"]).a, pytest.raises(ValueError)), # type: ignore[attr-defined]
({"type": "str"}, object(), pytest.raises(ValueError)),
({"type": "str"}, {}, pytest.raises(ValueError)),
({"type": "str"}, [], pytest.raises(ValueError)),
Expand Down

0 comments on commit 74bba54

Please sign in to comment.