Skip to content

Commit

Permalink
chore: update for the ruff v0.1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrake committed Oct 20, 2023
1 parent 3ddaa76 commit 6760a7a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
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

0 comments on commit 6760a7a

Please sign in to comment.