Skip to content

Commit 980d76b

Browse files
docs: smart init in commands, config, READMEs + test count 706
- Add --pyproject flag to commands.md (EN/IT) - Add --pyproject to Getting Started in configuration/index.md (EN/IT) - Add Project setup section with zenzic init to README.md and README.it.md - Add smart init entry to CHANGELOG.md and RELEASE.md - Update test counts 694 → 706 across CHANGELOG.md and RELEASE.md
1 parent 6a62cff commit 980d76b

8 files changed

Lines changed: 83 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ Versions follow [Semantic Versioning](https://semver.org/).
7777
- `src/<module>/rules.py` module-level `BaseRule` template
7878
- minimal docs fixture and `zenzic.toml` so `zenzic check all` can run
7979

80+
- **Smart Initialization — `zenzic init --pyproject`** — when `pyproject.toml`
81+
exists, `zenzic init` interactively asks whether to embed configuration as a
82+
`[tool.zenzic]` table instead of creating a standalone `zenzic.toml`. Pass
83+
`--pyproject` to skip the prompt. `--force` overwrites an existing
84+
`[tool.zenzic]` section. Engine auto-detection works in both modes.
85+
8086
- `examples/plugin-scaffold-demo/` — living scaffold output fixture for SDK
8187
integration checks and contributor onboarding.
8288

@@ -254,7 +260,7 @@ Versions follow [Semantic Versioning](https://semver.org/).
254260
runner: `python3 -m pytest -x`, target: `src/zenzic/core/rules.py`.
255261
- **Performance baseline** relaxed from 150 ms → 200 ms for 5 000 in-memory
256262
resolutions to accommodate CI/nox environmental variance (resolver is O(1)).
257-
- **694 tests pass.** `just preflight` — all gates green:
263+
- **706 tests pass.** `just preflight` — all gates green:
258264
ruff ✓ · mypy ✓ · pytest 80%+ coverage ✓ · REUSE ✓ · zenzic self-audit ✓ · mkdocs build --strict ✓.
259265

260266
## [0.5.0a2] — 2026-04-03 — The Refined Sentinel: Lean Package & Unified Workflow

README.it.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ Zenzic esegue un'**analisi statica** dei tuoi file di configurazione (`mkdocs.ym
167167

168168
Questo significa che **non è necessario installare** MkDocs, Material for MkDocs o altri plugin di build nel tuo ambiente di linting. Zenzic rimane leggero e privo di dipendenze, rendendolo ideale per pipeline CI/CD veloci e isolate.
169169

170+
### Setup progetto
171+
172+
```bash
173+
zenzic init # crea zenzic.toml con engine rilevato automaticamente
174+
zenzic init --pyproject # incorpora [tool.zenzic] in pyproject.toml
175+
```
176+
177+
Quando `pyproject.toml` esiste, `zenzic init` chiede interattivamente se incorporare
178+
la configurazione lì. Usa `--pyproject` per saltare il prompt.
179+
170180
---
171181

172182
## Utilizzo CLI

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,16 @@ This means you **do not need to install** MkDocs, Material for MkDocs, or any ot
362362
> (PDFs, ZIPs), add their glob patterns to `excluded_build_artifacts` in `zenzic.toml`
363363
> rather than pre-generating them. See the [First-Class Integrations](#first-class-integrations) section above.
364364

365+
### Project setup
366+
367+
```bash
368+
zenzic init # creates zenzic.toml with auto-detected engine
369+
zenzic init --pyproject # embeds [tool.zenzic] in pyproject.toml instead
370+
```
371+
372+
When `pyproject.toml` exists, `zenzic init` asks interactively whether to embed
373+
configuration there. Pass `--pyproject` to skip the prompt.
374+
365375
---
366376

367377
## CLI usage

RELEASE.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,24 @@ serving as both a DX reference and a quality-gate integration test.
112112

113113
---
114114

115+
#### ⚡ Smart Initialization — `zenzic init --pyproject`
116+
117+
`zenzic init` now detects `pyproject.toml` in the project root and interactively
118+
asks whether to embed configuration as a `[tool.zenzic]` table instead of creating
119+
a standalone `zenzic.toml`.
120+
121+
```bash
122+
zenzic init # interactive: asks if pyproject.toml exists
123+
zenzic init --pyproject # skip the prompt, write directly into pyproject.toml
124+
zenzic init --force # overwrite existing config (both modes)
125+
```
126+
127+
Engine auto-detection (`mkdocs.yml``engine = "mkdocs"`, `zensical.toml`
128+
`engine = "zensical"`) works in both standalone and pyproject modes. When no
129+
engine config file is found, vanilla defaults apply.
130+
131+
---
132+
115133
#### 🛡️ Z001 / Z002 Split — Errors vs Warnings for Link Issues (closes #6)
116134

117135
`VSMBrokenLinkRule` now distinguishes:
@@ -165,7 +183,7 @@ repos:
165183
### Quality Gates
166184

167185
```text
168-
pytest 694 passed, 0 failed
186+
pytest 706 passed, 0 failed
169187
coverage 80%+ branch (gate: ≥ 80%)
170188
mutation score 86.7% (242/279 killed on rules.py — target: 75%)
171189
ruff check src/ 0 violations
@@ -243,7 +261,7 @@ installed for `zenzic check all` to pass.
243261

244262
All validation logic in Zenzic lives in pure functions: no file I/O, no network access, no global
245263
state, no terminal output. I/O happens only at the edges — CLI wrappers that read files and print
246-
findings. Pure functions are trivially testable (694 passing tests, ≥ 80% branch-coverage gate), composable
264+
findings. Pure functions are trivially testable (706 passing tests, ≥ 80% branch-coverage gate), composable
247265
into higher-order pipelines, and deterministic across environments.
248266

249267
The score you get on a developer laptop is the score CI gets. The score CI gets is the score you
@@ -569,7 +587,7 @@ and `diff` Python APIs has been renamed to `output_format` — update any progra
569587

570588
```text
571589
zenzic check all # self-dogfood: 7/7 OK
572-
pytest # 694 passed, 0 failed
590+
pytest # 706 passed, 0 failed
573591
coverage # ≥ 80% branch (hard gate)
574592
mutation score # 86.7% (242/279 killed on rules.py)
575593
ruff check . # 0 violations

docs/configuration/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ Use `zenzic init` to scaffold the file automatically. It detects the documentati
2626
project root (e.g. `mkdocs.yml`) and pre-sets `engine` in `[build_context]`:
2727

2828
```bash
29-
zenzic init # creates zenzic.toml with detected engine
30-
zenzic init --force # overwrite an existing file
29+
zenzic init # creates zenzic.toml with detected engine
30+
zenzic init --pyproject # embeds [tool.zenzic] in pyproject.toml instead
31+
zenzic init --force # overwrite an existing file
3132
```
3233

34+
When `pyproject.toml` exists, `zenzic init` asks whether to embed the configuration there
35+
as a `[tool.zenzic]` table. Pass `--pyproject` to skip the interactive prompt.
36+
3337
When you need to customise behaviour — for example, to raise the word-count threshold for concise
3438
technical reference pages, or to add team-specific placeholder patterns — create or edit
3539
`zenzic.toml` at the repository root:

docs/it/configuration/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ Usa `zenzic init` per scaffoldare il file automaticamente. Rileva il motore di d
2929
dalla root del progetto (es. `mkdocs.yml`) e preimposta `engine` in `[build_context]`:
3030

3131
```bash
32-
zenzic init # crea zenzic.toml con engine rilevato
33-
zenzic init --force # sovrascrive un file esistente
32+
zenzic init # crea zenzic.toml con engine rilevato
33+
zenzic init --pyproject # incorpora [tool.zenzic] in pyproject.toml
34+
zenzic init --force # sovrascrive un file esistente
3435
```
3536

37+
Quando `pyproject.toml` esiste, `zenzic init` chiede se incorporare la configurazione lì
38+
come tabella `[tool.zenzic]`. Usa `--pyproject` per saltare il prompt interattivo.
39+
3640
Crea o modifica `zenzic.toml` nella root del repository quando hai bisogno di personalizzare il
3741
comportamento:
3842

docs/it/usage/commands.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,21 @@ Puoi anche impostare `exit_zero = true` in `zenzic.toml` per renderlo il default
5555

5656
```bash
5757
zenzic init # Crea zenzic.toml nel progetto corrente
58-
zenzic init --force # Sovrascrive zenzic.toml esistente
58+
zenzic init --pyproject # Scrive la config in pyproject.toml [tool.zenzic]
59+
zenzic init --force # Sovrascrive la config esistente senza prompt
5960
zenzic init --plugin plugin-scaffold-demo # Crea un pacchetto SDK plugin
6061
```
6162

63+
**Rilevamento intelligente** — quando `pyproject.toml` esiste nella root del progetto,
64+
`zenzic init` chiede se incorporare la configurazione lì come tabella `[tool.zenzic]`
65+
invece di creare un file `zenzic.toml` separato. Usa `--pyproject` per saltare il
66+
prompt e scrivere direttamente in `pyproject.toml`.
67+
68+
Il rilevamento automatico dell'engine è incluso in entrambe le modalità: se `mkdocs.yml`
69+
o `zensical.toml` è presente, la configurazione generata preimposta il campo `engine`.
70+
Se non viene trovato alcun file di configurazione engine, si applicano i default
71+
vanilla (indipendenti dall'engine).
72+
6273
`zenzic init --plugin <nome>` genera uno scheletro di pacchetto Python con
6374
entry-point `zenzic.rules` pronto all'uso e template `BaseRule`
6475
(`src/<modulo>/rules.py`). Include anche una fixture docs minima, cosi il

docs/usage/commands.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,20 @@ You can also set `exit_zero = true` in `zenzic.toml` to make it the permanent de
5454

5555
```bash
5656
zenzic init # Scaffold zenzic.toml in the current project
57-
zenzic init --force # Overwrite existing zenzic.toml
57+
zenzic init --pyproject # Write config into pyproject.toml [tool.zenzic]
58+
zenzic init --force # Overwrite existing config without prompting
5859
zenzic init --plugin plugin-scaffold-demo # Scaffold a plugin SDK package
5960
```
6061

62+
**Smart detection** — when `pyproject.toml` exists in the project root, `zenzic init`
63+
asks whether to embed the configuration there as a `[tool.zenzic]` table instead of
64+
creating a separate `zenzic.toml`. Pass `--pyproject` to skip the prompt and write
65+
directly into `pyproject.toml`.
66+
67+
Engine auto-detection is included in both modes: if `mkdocs.yml` or `zensical.toml`
68+
is present, the generated configuration pre-sets the `engine` field accordingly.
69+
When no engine config file is found, vanilla (engine-agnostic) defaults apply.
70+
6171
`zenzic init --plugin <name>` generates a Python package skeleton with a ready
6272
`zenzic.rules` entry-point and a `BaseRule` template (`src/<module>/rules.py`).
6373
It also includes a minimal docs fixture so the generated project can immediately

0 commit comments

Comments
 (0)