Skip to content

Commit

Permalink
chore: ruff moved to astral-sh (#102)
Browse files Browse the repository at this point in the history
* chore: ruff moved to astral-sh

* Update processor.py

* chore: make ruff mutable classvar check happy

Signed-off-by: Henry Schreiner <[email protected]>

* chore: bump versions

Signed-off-by: Henry Schreiner <[email protected]>

* chore: hide check waiting for a new release of sp-repo-review

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Jul 3, 2023
1 parent 25501bd commit 962c360
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ repos:
- id: black-jupyter

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.14.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.1.0]
additional_dependencies: [black==23.3.0]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.270"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.276"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -48,7 +48,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.4.1
hooks:
- id: mypy
files: (src|web|tests)
Expand All @@ -62,13 +62,13 @@ repos:
- types-PyYAML

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
args: ["-Lhist,absense"]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
rev: v0.9.0.5
hooks:
- id: shellcheck

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,6 @@ flake8-unused-arguments.ignore-variadic-names = true
[tool.ruff.per-file-ignores]
"src/repo_review/_compat/**.py" = ["TID251"]
"src/**/__main__.py" = ["T20"]

[tool.repo-review]
ignore = ["PC190"] # Remove after first July 2023 release of sp-repo-review
2 changes: 1 addition & 1 deletion src/repo_review/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def process(
# Run all the checks in topological order based on their dependencies
ts = graphlib.TopologicalSorter(graph)
for name in ts.static_order():
if all(completed.get(n, "") == "" for n in graph[name]): # noqa: PLC1901
if all(completed.get(n, "") == "" for n in graph[name]):
result = apply_fixtures(fixtures, tasks[name].check)
if isinstance(result, bool):
completed[name] = "" if result else tasks[name].check.__doc__
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_process_fixtures_with_package() -> None:

assert apply_fixtures(fixtures, nothing) == 42
assert apply_fixtures(fixtures, simple) == "."
assert apply_fixtures(fixtures, lambda package: package) == Path(".") # type: ignore[no-any-return]
assert apply_fixtures(fixtures, lambda package: package) == Path(".")
assert apply_fixtures(fixtures, not_simple) == ". ."


Expand Down
8 changes: 4 additions & 4 deletions tests/test_utilities/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PyProject:
class PP002(PyProject):
"Has a proper build-system table"

requires = {"PY001"}
requires = frozenset(("PY001",))
url = "https://packaging.python.org/en/latest/specifications/declaring-build-dependencies"

@staticmethod
Expand All @@ -90,7 +90,7 @@ def check(pyproject: dict[str, Any]) -> bool:
class PP003(PyProject):
"Does not list wheel as a build-dep"

requires = {"PY001"}
requires = frozenset(("PY001",))

@staticmethod
def check(pyproject: dict[str, Any]) -> bool:
Expand All @@ -110,7 +110,7 @@ def check(pyproject: dict[str, Any]) -> bool:
class PP301(PyProject):
"Has pytest in pyproject"

requires = {"PY001"}
requires = frozenset(("PY001",))

@staticmethod
def check(pyproject: dict[str, Any]) -> bool:
Expand All @@ -129,7 +129,7 @@ def check(pyproject: dict[str, Any]) -> bool:

class PP302(PyProject):
"Sets a minimum pytest to at least 6"
requires = {"PP301"}
requires = frozenset(("PP301",))

@staticmethod
def check(pyproject: dict[str, Any]) -> bool:
Expand Down

0 comments on commit 962c360

Please sign in to comment.