@itcase/config 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -137,6 +137,16 @@ make smart-commit-dry # если есть Makefile
137
137
  make smart-commit
138
138
  ```
139
139
 
140
+ Пропустить husky (`lint-staged`, `commit-msg`): `--no-verify` уходит в `git commit` и хуки не запускаются. Сообщение smart-commit всё равно проверяет сам.
141
+
142
+ ```bash
143
+ npm run smart-commit -- --no-verify
144
+ make -- smart-commit --no-verify
145
+ make smart-commit FLAGS=--no-verify
146
+ ```
147
+
148
+ `make smart-commit --no-verify` без `--` не сработает: GNU make забирает `--*` как свою опцию.
149
+
140
150
  В самом `@itcase/config` (разработка пакета):
141
151
 
142
152
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {
@@ -48,7 +48,7 @@ const AGENT_WAIT_STEPS = [
48
48
  'Still thinking',
49
49
  'Waiting for response',
50
50
  ]
51
- const HELP = `smart-commit [--dry-run] [--yes|-y] [--type t] [--model id] [--verbose]
51
+ const HELP = `smart-commit [--dry-run] [--yes|-y] [--no-verify] [--type t] [--model id] [--verbose]
52
52
  [--cat|--nyan] [--banana] [--upyachka]
53
53
 
54
54
  Cursor Agent → commit messages by SCOPES → [y/N] → git commit
@@ -56,6 +56,10 @@ Run via: npm exec smart-commit (from project with @itcase/config)
56
56
  Needs: agent login (or CURSOR_API_KEY) + commitlint.config.* with SCOPES
57
57
  Default model: ${DEFAULT_MODEL} (override with --model / SMART_COMMIT_MODEL).
58
58
 
59
+ --no-verify is passed to git commit and skips hooks
60
+ (husky pre-commit / lint-staged and commit-msg). Commit message
61
+ is still checked by smart-commit before git runs.
62
+
59
63
  Progress sprite is random (nyan cat, banana, or upyachka).
60
64
  Force with --cat, --banana, or --upyachka. Agent log is below.
61
65
  `
@@ -181,9 +185,17 @@ async function main(argv) {
181
185
  )
182
186
  }
183
187
 
184
- process.stdout.write(' git commit (husky)…\n')
188
+ process.stdout.write(
189
+ option.noVerify
190
+ ? ' git commit --no-verify (hooks skipped)…\n'
191
+ : ' git commit (husky)…\n',
192
+ )
185
193
  try {
186
- git(cwd, ['commit', '-m', plan.message], { inherit: true })
194
+ const commitArgs = ['commit', '-m', plan.message]
195
+ // Skips pre-commit (lint-staged) and commit-msg. lint-staged has no
196
+ // equivalent flag — the hook simply does not run.
197
+ if (option.noVerify) commitArgs.push('--no-verify')
198
+ git(cwd, commitArgs, { inherit: true })
187
199
  } catch (error) {
188
200
  throw new Error(`git commit failed: ${plan.message}\n${error.message}`, {
189
201
  cause: error,
@@ -208,6 +220,7 @@ function parseArgs(argv) {
208
220
  type: '',
209
221
  dryRun: false,
210
222
  model: '',
223
+ noVerify: false,
211
224
  sprite: '',
212
225
  staged: false,
213
226
  verbose: false,
@@ -216,6 +229,7 @@ function parseArgs(argv) {
216
229
  for (let i = 0; i < argv.length; i++) {
217
230
  const arg = argv[i]
218
231
  if (arg === '--dry-run') option.dryRun = true
232
+ else if (arg === '--no-verify') option.noVerify = true
219
233
  else if (arg === '--yes' || arg === '-y') option.yes = true
220
234
  else if (arg === '--verbose') option.verbose = true
221
235
  else if (arg === '--staged') option.staged = true