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

chore: ruff moved to astral-sh #102

Merged
merged 5 commits into from
Jul 3, 2023
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
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