ci: mirror hashview lint & security gates#137
Merged
Conversation
Normalizes formatting across the package so `ruff format --check` (added to CI in a following commit) passes. No behavioral changes. Co-Authored-By: Claude <noreply@anthropic.com>
Adds the gates the hashview repo runs, adapted to hate_crack's uv toolchain: - ruff format --check as a CI step + a ruff-format prek pre-push hook (the package was reformatted in the preceding commit). - Bandit SAST vs a committed baseline (.bandit-baseline.json, 114 reviewed low-severity subprocess/shlex findings); [tool.bandit] config in pyproject.toml; CI job + prek pre-push hook. Only NEW findings fail. - pip-audit dependency-CVE gate (CI job). PYSEC-2026-2447 (diskcache 5.6.3, transitive via instructor -> atomic-agents) is ignored — no upstream fix. - Hygiene pre-commit hooks (trailing-whitespace, end-of-file-fixer, check-yaml, check-merge-conflict, check-added-large-files) via the pre-commit-hooks repo. - CLAUDE.md updated: lint/security commands, prek install (+pre-commit hook type), and the active-hooks list. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors the lint and security gates the
hashviewrepo runs, adapted to hate_crack'suvtoolchain. Requested to add format checking to CI, then extended to the rest of hashview's gates where they fit.New CI (
ci.yml) — three jobs:ruff format --checkalongside the existing ruff lint, ty, and pytest..bandit-baseline.json); only new findings fail. hate_crack shells out to hashcat heavily, so the baseline captures 114 reviewed low-severitysubprocess/shlexfindings. Config in[tool.bandit].PYSEC-2026-2447(diskcache 5.6.3, transitive via instructor → atomic-agents) is ignored — no fixed release exists upstream yet.Local hooks (
prek.toml):ruff-formatandbanditadded at pre-push (mirror the CI gates).pre-commit/pre-commit-hooksat pre-commit stage: trailing-whitespace, end-of-file-fixer, check-yaml, check-merge-conflict, check-added-large-files.Also:
ruff format) in a separatestyle:commit so the CI format check passes — this is the bulk of the diff and is whitespace-only.CLAUDE.mdupdated: lint/security commands,prek installnow includes--hook-type pre-commit, and the active-hooks list.Not mirrored (don't fit): openapi-spec-validator (no API spec), pylint (ruff + ty already cover lint), mutation testing / multi-python matrix (overkill here).
Test Plan
All gates verified locally before push:
ruff check— cleanruff format --check— 17 files already formattedty check— exit 0bandit -b .bandit-baseline.json— exit 0 (no new findings)pip-audit --ignore-vuln PYSEC-2026-2447— no known vulnerabilitiespytest— 1044 passed (1 pre-existing test: hate_path global leak in test_markov_e2e.py can flake test_main_pcfg #118 ordering flake, passes in isolation)🤖 Generated with Claude Code