Skip to content

add Python CI quality gates, sign release tags, and bump to v0.6.2#38

Merged
pzverkov merged 1 commit into
mainfrom
ci/python-static-analysis
Jun 3, 2026
Merged

add Python CI quality gates, sign release tags, and bump to v0.6.2#38
pzverkov merged 1 commit into
mainfrom
ci/python-static-analysis

Conversation

@pzverkov

@pzverkov pzverkov commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Closes the Python static-analysis gap in CI: shellcheck linted the shell scripts, but nothing linted, security-scanned, or coverage-measured the primary language (Python). Adds ruff, bandit, coverage, and ascii CI jobs, signs release tags, and bumps the version to v0.6.2.

What changed

CI jobs (.github/workflows/ci.yml)

  • ruff - runs ruff check lib tests bench.
  • bandit - runs bandit -c pyproject.toml -r lib; [tool.bandit] skips mirror the already-accepted ruff S ignores. The one Medium finding (a fixed-URL urlopen in update_check.py) is suppressed inline with # nosec B310, not globally.
  • coverage - statement coverage gated at 65% (Silver target is 80%). The hooks and daemon run as subprocesses, so the job sets up COVERAGE_PROCESS_START + a .pth and coverage combine to measure them (an in-process run undercounts: it read 59% while the true figure is 67%).
  • ascii - git grep -P '[^\x00-\x7F]' excluding the three intentional unicode test fixtures.

ASCII sweep

  • Removed pre-existing em-dashes from lib/_common.py, lib/doctor.py, lib/hook_session_start.py, lib/update_check.py, docs/positioning.md, and bench/HISTORY.md (plus -> / x for the arrow and multiplication glyphs in HISTORY). The byte-class grep documented in CONTRIBUTING never actually matched em-dashes; corrected that note to the reliable [^\x00-\x7F] form.

Release hygiene

  • Release tags are now GPG-signed: the repo sets user.signingkey, and the CONTRIBUTING release flow uses git tag -s (with the GitHub "Verified" prerequisites noted). Pre-stages the Silver signed_releases item. release.yml is unchanged - it only reacts to a pushed tag.

Docs / config

  • Test-policy statement in CONTRIBUTING + a PR-template checkbox.
  • README "Reporting bugs" pointer.
  • bandit and coverage added to the dev dependency group; bandit added to the local pre-PR checks, coverage reproduction documented.

Version

  • Bumps to v0.6.2 in .claude-plugin/plugin.json and lib/__init__.py (the latter had drifted to 0.6.0), with a CHANGELOG entry and regenerated MANIFEST.lock.

Together these close the remaining OpenSSF Best Practices passing-badge gaps (static_analysis, warnings, test_policy) and pre-stage two Silver items (test_statement_coverage80, signed_releases). The badge itself is a separate maintainer registration step.

No runtime behavior change: the only lib edits are comments/docstrings, one nosec, and the version string.

shellcheck gated the shell scripts, but the primary language (Python) had no linter, security scanner, or coverage in CI, and the ASCII-only / no-em-dash constraint went unenforced (the byte-class grep in CONTRIBUTING never matched em-dashes). This adds four CI jobs and tightens release hygiene.

- ruff: ruff check lib tests bench.
- bandit: bandit -c pyproject.toml -r lib; skips mirror the accepted ruff S ignores, with one fixed-URL urlopen suppressed inline via nosec B310.
- coverage: statement coverage gated at 65% (Silver target 80%), measuring the subprocess-run hooks and daemon via COVERAGE_PROCESS_START plus coverage combine (an in-process run undercounts at 59% against the true 67%).
- ascii: git grep over tracked files, excluding the three intentional unicode test fixtures; swept pre-existing em-dashes out of lib, docs, and bench.

Release tags are now GPG-signed (git tag -s, user.signingkey set). Also adds a test-policy statement, a README bug-reporting pointer, and bandit plus coverage to the dev group. Bumps to v0.6.2 and realigns lib/__init__.py (it had drifted to 0.6.0).

Closes the OpenSSF passing-badge gaps (static_analysis, warnings, test_policy) and pre-stages the Silver test_statement_coverage80 and signed_releases items. No runtime behavior change.
@pzverkov pzverkov force-pushed the ci/python-static-analysis branch from c196d42 to 0a2be6a Compare June 3, 2026 00:43
@pzverkov pzverkov changed the title ci: add python static-analysis (ruff + bandit) and ascii gate (v0.6.2) add Python CI quality gates, sign release tags, and bump to v0.6.2 Jun 3, 2026
@pzverkov pzverkov self-assigned this Jun 3, 2026
@pzverkov pzverkov merged commit 814c85d into main Jun 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant