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: update for the ruff v0.1.1 release #338

Merged
merged 2 commits into from
Oct 20, 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 42f98979dbdfcd148dff424477552b8816a7cf01 # frozen: v0.0.292
rev: 51ae37a7805e6d6f791a373b7d7752d023ea6c0f # frozen: v0.1.1
hooks:
- id: ruff

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ ignore = [
"RET504", # unnecessary-assign
# Allowing exception handling within loops improves readability with only a negligible performance impact.
"PERF203", # try-except-in-loop
# This code base does not require a license header at the top of every file.
"CPY001", # missing-copyright-notice
# These ignores will be removed during https://github.com/phylum-dev/phylum-ci/issues/238
"ANN", # flake8-annotations
"TCH", # flake8-type-checking
Expand Down
2 changes: 1 addition & 1 deletion src/phylum/ci/ci_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _check_prerequisites(self) -> None:
self.triggering_repo = os.getenv("BUILD_REPOSITORY_PROVIDER", "unknown")
LOG.debug("Triggering repository: %s", self.triggering_repo)
# "TfsGit" is the legacy name for "Azure Repos Git"
if self.triggering_repo not in ("TfsGit", "GitHub"):
if self.triggering_repo not in {"TfsGit", "GitHub"}:
msg = f"Triggering repository `{self.triggering_repo}` not supported"
raise SystemExit(msg)

Expand Down
2 changes: 1 addition & 1 deletion src/phylum/ci/ci_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def analyze(self) -> None:
new_packages = sorted({pkg for lockfile in self.lockfiles for pkg in lockfile.new_deps})
LOG.debug("%s unique newly added dependencies", len(new_packages))

with tempfile.NamedTemporaryFile(mode="w+", prefix="base_", suffix=".json") as base_fd:
with tempfile.NamedTemporaryFile(mode="w+", encoding="utf-8", prefix="base_", suffix=".json") as base_fd:
json.dump(base_pkgs, base_fd, cls=DataclassJSONEncoder)
base_fd.flush()
cmd.append(base_fd.name)
Expand Down