diff --git a/.husky/commit-msg b/.husky/commit-msg index a839376..be93a78 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,4 @@ -# RuleOfCode v7.17.3 Commit Message Validation +# RuleOfCode v7.17.4 Commit Message Validation # Config-driven validation with 1 pattern(s) # husky v9+ native hook (no deprecated v8 boilerplate) @@ -28,7 +28,7 @@ fi if [ "$VALID" = false ]; then echo "❌ Invalid commit message format!" echo "" - echo "🏛️ RuleOfCode v7.17.3 Constitutional Commit Message Format:" + echo "🏛️ RuleOfCode v7.17.4 Constitutional Commit Message Format:" echo " Your message must match one of the configured patterns" echo "" echo "Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert" @@ -68,4 +68,4 @@ if [ "$EXEMPT" = false ]; then fi fi -echo "✅ Commit message format validated (RuleOfCode v7.17.3)" +echo "✅ Commit message format validated (RuleOfCode v7.17.4)" diff --git a/.husky/pre-commit b/.husky/pre-commit index c1363e6..aebc547 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,5 @@ -# RuleOfCode v7.17.3 Constitutional Checkpoint (husky v9+ native hook) -echo "🏛️ RuleOfCode v7.17.3 Constitutional Checkpoint with lint-staged" +# RuleOfCode v7.17.4 Constitutional Checkpoint (husky v9+ native hook) +echo "🏛️ RuleOfCode v7.17.4 Constitutional Checkpoint with lint-staged" npx lint-staged # Run constitutional audit on staged files diff --git a/.husky/pre-push b/.husky/pre-push index 20bb306..a66e2d2 100644 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,5 @@ -# RuleOfCode v7.17.3 Constitutional Compliance Pre-Push Hook (husky v9+ native) -echo "🏛️ RuleOfCode v7.17.3 Constitutional Checkpoint - Pre-Push Mode" +# RuleOfCode v7.17.4 Constitutional Compliance Pre-Push Hook (husky v9+ native) +echo "🏛️ RuleOfCode v7.17.4 Constitutional Checkpoint - Pre-Push Mode" echo "═════════════════════════════════════════════════════" # Run full RuleOfCode audit before push diff --git a/CHANGELOG.md b/CHANGELOG.md index 0afbbed..423dd3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,28 @@ All notable changes to RuleOfCode will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [7.17.4] - 2026-08-07 + +### 🐛 Fixed — `init` crashed instead of setting up when there is no terminal + +`ruleofcode init` asks its questions through inquirer, which needs a real terminal to +answer them. In CI, in a container, or behind a pipe there is none: readline +force-closes and the process dies with an `ERR_USE_AFTER_CLOSE` stack trace and exit 7 — +a setup tool crashing rather than setting anything up. + +Three behaviours now, each stated out loud: + +- **no terminal, no config yet** — runs the same defaults `--quick` documents, and says + that is what happened instead of pretending you chose them; +- **no terminal, config already there** — refuses and points at `--force`. Overwriting a + tuned config because nobody was present to object is the destructive answer to the + question; +- **`--force`** still overwrites, terminal or not. + +The terminal requirement belongs to inquirer specifically, so an embedder that injects +its own prompt function is unaffected. No verdict change: `init` writes configuration, +it does not judge code. + ## [7.17.3] - 2026-08-07 First release published to npm as **`ruleofcode`**. diff --git a/package.json b/package.json index 095d06d..4bb127f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ruleofcode", - "version": "7.17.3", + "version": "7.17.4", "description": "Constitutional-compliance CLI — audit a codebase against a catalog of laws and get one honest pass-or-fail verdict, with git hooks. Supports TypeScript, Angular and Python.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/hooks/installer.ts b/src/hooks/installer.ts index 8ed40f9..22cef35 100644 --- a/src/hooks/installer.ts +++ b/src/hooks/installer.ts @@ -17,7 +17,7 @@ export interface HooksInstallOptions { } export class GitHooksInstaller { - private static readonly VERSION = '7.17.3'; + private static readonly VERSION = '7.17.4'; private static readonly PACKAGE_JSON_FILE = 'package.json'; private static readonly HUSKY_DIR = '.husky'; private static readonly PRE_COMMIT_HOOK = 'pre-commit';