Skip to content

Commit 5c86aaf

Browse files
committed
chore: pre-commit clean run — ruff-format, markdownlint, mypy 1.11
Wired all hooks into a clean run that contributors can rely on: - ruff-format: applied formatting across 46 .py files (single-line collapses, parameter wrapping). No behavior changes. - markdownlint: auto-fix swept blank-line and end-of-file issues across 14 doc files. Manual fixes: 5 fenced blocks gained `text` language (tree diagrams + plain output), 2 long lines wrapped, MD029 disabled in config because the walkthroughs use explicit step numbers across code-block separators. - detect-private-key: excluded .env-example (placeholder PGP block header was flagging on its `-----BEGIN ...-----` marker). - mypy 1.11 (the pre-commit pin) flagged `Returning Any` on keyring.get_password; added an explicit `str | None` binding. Local mypy 2.1.0 didn't catch it but consistency wins. - ruff PT004: clean_env fixture in conftest.py is setup-only and intentionally named without an underscore (it's visible at test call sites as a setup marker); silenced for that one file. - Scoped pre-commit mypy to `src/` to match CI invocation; was reaching into `tests/` with --strict and surfacing untyped test helpers that CI doesn't gate.
1 parent 3f4227a commit 5c86aaf

65 files changed

Lines changed: 241 additions & 182 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.markdownlint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"headings": false
88
},
99
"MD024": { "siblings_only": true },
10+
"MD029": false,
1011
"MD033": { "allowed_elements": ["br", "details", "summary", "kbd", "sub", "sup"] },
1112
"MD041": false,
1213
"MD046": { "style": "fenced" }

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ repos:
1111
- id: check-added-large-files
1212
args: [--maxkb=500]
1313
- id: detect-private-key
14+
exclude: '\.env-example$' # placeholder values for docs, not real keys
1415
- id: mixed-line-ending
1516
args: [--fix=lf]
1617

@@ -31,6 +32,7 @@ repos:
3132
- structlog>=24.1
3233
- types-PyYAML
3334
args: [--strict, --ignore-missing-imports]
35+
files: '^src/'
3436

3537
- repo: https://github.com/Yelp/detect-secrets
3638
rev: v1.5.0

.secrets.baseline

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@
9090
{
9191
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
9292
},
93+
{
94+
"path": "detect_secrets.filters.common.is_baseline_file",
95+
"filename": ".secrets.baseline"
96+
},
9397
{
9498
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
9599
"min_level": 2
@@ -151,9 +155,9 @@
151155
"filename": "tests/platforms/git_hosts/test_variants.py",
152156
"hashed_secret": "90bd1b48e958257948487b90bee080ba5ed00caa",
153157
"is_verified": false,
154-
"line_number": 173
158+
"line_number": 164
155159
}
156160
]
157161
},
158-
"generated_at": "2026-05-15T15:49:28Z"
162+
"generated_at": "2026-05-15T16:41:14Z"
159163
}

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,3 @@ For answers to common questions about this code of conduct, see the FAQ at [http
8282
[Mozilla CoC]: https://github.com/mozilla/diversity
8383
[FAQ]: https://www.contributor-covenant.org/faq
8484
[translations]: https://www.contributor-covenant.org/translations
85-

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ internals. Treat it as the map; per-platform contracts live in
66

77
## Layout
88

9-
```
9+
```text
1010
src/release_kit/
1111
├── cli/ Typer entry points (one verb per @app.command)
1212
├── core/

docs/playbook/cross-cutting/preflight.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ automates almost all of this; run it before every release.
8888

8989
## When release-kit handles it
9090

91-
```
91+
```bash
9292
release-kit doctor
9393
```
9494

9595
Output is a per-target table:
9696

97-
```
97+
```text
9898
target status detail
9999
pypi GREEN OIDC trust policy resolves; version 1.4.2 not yet published; CHANGELOG dated
100100
npm AMBER token expires in 7 days; rotate via `release-kit rotate-tokens npm`

docs/playbook/cross-cutting/provenance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ With provenance:
3131
### Sigstore (`cosign` / `gitsign`)
3232

3333
Free, keyless, public-log-backed signing. Adopted by:
34+
3435
- npm (provenance, since 2023)
3536
- PyPI (attestations, PEP 740, since 2024)
3637
- Docker (Notary v2 / Sigstore for OCI artifacts)
@@ -54,6 +55,7 @@ jobs:
5455
```
5556
5657
Verify:
58+
5759
```bash
5860
# bash
5961
npm view <pkg> --json | jq .dist.attestations
@@ -66,6 +68,7 @@ Automatic when you publish via OIDC trusted publisher and the
6668
`attestations: true`.
6769

6870
Verify:
71+
6972
```bash
7073
# bash
7174
pip download --no-deps simtabi-release-kit
@@ -90,6 +93,7 @@ sigstore verify identity \
9093
```
9194
9295
Verify:
96+
9397
```bash
9498
# bash
9599
cosign verify ghcr.io/simtabi/example:<tag> \
@@ -129,6 +133,7 @@ mvn deploy -Dgpg.passphrase="$GPG_PASSPHRASE"
129133
```
130134

131135
Store the **private key** and **passphrase** as separate CI secrets:
136+
132137
- `GPG_PRIVATE_KEY` = output of `gpg --export-secret-keys --armor $KEYID`
133138
- `GPG_PASSPHRASE` = the passphrase
134139

docs/playbook/cross-cutting/secrets.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ publish-pypi:
8383
```
8484
8585
Set `PYPI_TOKEN` at **Settings → CI/CD → Variables**:
86+
8687
- Type: `Variable`
8788
- **Protected**: ✅ (only protected refs / tags)
8889
- **Masked**: ✅
@@ -188,6 +189,7 @@ grep -q '^\.env$' .gitignore || echo "MISSING: add .env to .gitignore"
188189

189190
`release-kit rotate-tokens <platform>` walks an interactive
190191
rotation:
192+
191193
1. Open the registry's token-management page in the user's browser.
192194
2. Prompt for the new token.
193195
3. Update the OS keyring entry.

docs/playbook/cross-cutting/token-scoping.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ narrowest the platform supports.
6161
## GHCR (GitHub Container Registry)
6262

6363
Same as GitHub PAT above:
64+
6465
- Push: `packages:write` (classic) or `Packages: Read & write`
6566
(fine-grained)
6667
- Pull (public): no auth required

docs/playbook/git-hosts/azure-devops.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ az repos policy build create \
7272

7373
UI: User settings (top-right) → **Personal access tokens →
7474
New Token**:
75+
7576
- Name: `release-kit-publish`
7677
- Scopes: Code (Read & write); Build (Read & execute); Release
7778
(Read, write & execute) — pick narrowest sufficient set
@@ -161,4 +162,5 @@ az pipelines runs list --project <project> --branch refs/tags/v1.4.2
161162

162163
- [Azure DevOps REST API](https://learn.microsoft.com/rest/api/azure/devops/)
163164
- [Azure Pipelines YAML schema](https://learn.microsoft.com/azure/devops/pipelines/yaml-schema/)
164-
- [`../registries/acr.md`](../registries/acr.md) — Azure Container Registry pairs naturally with Azure DevOps Pipelines
165+
- [`../registries/acr.md`](../registries/acr.md) — Azure Container
166+
Registry pairs naturally with Azure DevOps Pipelines

0 commit comments

Comments
 (0)