@codyswann/lisa 1.9.2 → 1.9.3
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.
|
@@ -356,6 +356,63 @@ The hook is configured in `.claude/settings.json`:
|
|
|
356
356
|
|
|
357
357
|
ntfy.sh topics are public by default. Use a unique, hard-to-guess topic name. For private notifications, you can [self-host ntfy](https://docs.ntfy.sh/install/) or use [ntfy.sh access control](https://docs.ntfy.sh/publish/#access-control).
|
|
358
358
|
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### pre-push.sh
|
|
362
|
+
|
|
363
|
+
**Type**: Pre-push git hook (blocking)
|
|
364
|
+
**Trigger**: Before `git push` executes
|
|
365
|
+
**Purpose**: Runs slow ESLint rules to catch linting issues before pushing to remote
|
|
366
|
+
|
|
367
|
+
#### How it works
|
|
368
|
+
|
|
369
|
+
1. Checks if the project has a `lint:slow` script defined in `package.json`
|
|
370
|
+
2. Detects the project's package manager from lock files (bun, pnpm, yarn, npm)
|
|
371
|
+
3. Runs the slow lint rules using the detected package manager
|
|
372
|
+
4. If lint:slow passes, allows the push to proceed
|
|
373
|
+
5. If lint:slow fails, blocks the push with an error message
|
|
374
|
+
|
|
375
|
+
#### Features
|
|
376
|
+
|
|
377
|
+
- **Blocking enforcement**: Prevents pushes with linting issues
|
|
378
|
+
- **Package manager detection**: Uses the project's configured package manager
|
|
379
|
+
- **Graceful skip**: If lint:slow script doesn't exist, skips silently without blocking
|
|
380
|
+
- **Clear feedback**: Shows which rules failed for easy fixing
|
|
381
|
+
- **Works with all package managers**: npm, yarn, pnpm, bun
|
|
382
|
+
|
|
383
|
+
#### Configuration
|
|
384
|
+
|
|
385
|
+
The hook is automatically registered via git when Lisa is applied. To manually configure or troubleshoot:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# Verify the hook is installed
|
|
389
|
+
ls -la .git/hooks/pre-push
|
|
390
|
+
|
|
391
|
+
# Run the hook manually to test
|
|
392
|
+
./.claude/hooks/pre-push.sh
|
|
393
|
+
|
|
394
|
+
# Bypass the hook (not recommended, only for emergencies)
|
|
395
|
+
git push --no-verify
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
#### Typical Workflow
|
|
399
|
+
|
|
400
|
+
1. Make code changes
|
|
401
|
+
2. Run `git push`
|
|
402
|
+
3. Pre-push hook runs slow lint rules
|
|
403
|
+
4. If issues found: hook blocks push, shows errors, exit with code 1
|
|
404
|
+
5. Fix the issues
|
|
405
|
+
6. Run `git push` again
|
|
406
|
+
7. If all clear: push proceeds normally
|
|
407
|
+
|
|
408
|
+
#### Notes
|
|
409
|
+
|
|
410
|
+
- This hook enforces blocking behavior (exits with code 1 on failure) to prevent pushing code with issues
|
|
411
|
+
- The hook respects the project's package manager configuration
|
|
412
|
+
- Only runs if a `lint:slow` script is defined in package.json (gracefully skips otherwise)
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
359
416
|
## Adding New Hooks
|
|
360
417
|
|
|
361
418
|
To add a new hook:
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# This file is managed by Lisa.
|
|
3
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
|
|
5
|
+
# Hook script to run slow lint rules before pushing
|
|
6
|
+
# Blocks push if lint:slow fails, preventing pushes with linting issues
|
|
7
|
+
# Reference: https://docs.claude.com/en/docs/claude-code/hooks
|
|
8
|
+
|
|
9
|
+
# Check if package.json has lint:slow script
|
|
10
|
+
if ! grep -q '"lint:slow"' package.json 2>/dev/null; then
|
|
11
|
+
echo "ℹ Skipping lint:slow: lint:slow script not found in package.json"
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# Detect package manager based on lock file presence
|
|
16
|
+
detect_package_manager() {
|
|
17
|
+
if [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
18
|
+
echo "bun"
|
|
19
|
+
elif [ -f "pnpm-lock.yaml" ]; then
|
|
20
|
+
echo "pnpm"
|
|
21
|
+
elif [ -f "yarn.lock" ]; then
|
|
22
|
+
echo "yarn"
|
|
23
|
+
elif [ -f "package-lock.json" ]; then
|
|
24
|
+
echo "npm"
|
|
25
|
+
else
|
|
26
|
+
echo "npm" # Default fallback
|
|
27
|
+
fi
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
PKG_MANAGER=$(detect_package_manager)
|
|
31
|
+
|
|
32
|
+
echo "🐢 Running slow lint rules before push..."
|
|
33
|
+
|
|
34
|
+
# Run lint:slow - exit code matters here, we want to block the push if it fails
|
|
35
|
+
if $PKG_MANAGER run lint:slow; then
|
|
36
|
+
echo "✓ Slow lint rules passed"
|
|
37
|
+
exit 0
|
|
38
|
+
else
|
|
39
|
+
echo "✗ Slow lint rules failed. Fix issues and try again." >&2
|
|
40
|
+
exit 1 # Block the push
|
|
41
|
+
fi
|
package/package.json
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@ast-grep/cli"
|
|
81
81
|
],
|
|
82
82
|
"name": "@codyswann/lisa",
|
|
83
|
-
"version": "1.9.
|
|
83
|
+
"version": "1.9.3",
|
|
84
84
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
85
85
|
"main": "dist/index.js",
|
|
86
86
|
"bin": {
|
|
@@ -93,8 +93,13 @@ on:
|
|
|
93
93
|
required: false
|
|
94
94
|
default: false
|
|
95
95
|
type: boolean
|
|
96
|
+
skip_lint_slow:
|
|
97
|
+
description: 'Skip the slow lint rules job'
|
|
98
|
+
required: false
|
|
99
|
+
default: false
|
|
100
|
+
type: boolean
|
|
96
101
|
skip_jobs:
|
|
97
|
-
description: 'Jobs to skip (comma-separated: lint,typecheck,test,test:unit,test:integration,test:e2e,maestro_e2e,playwright_e2e,format,build,dead_code,sg_scan,npm_security_scan,github_issue)'
|
|
102
|
+
description: 'Jobs to skip (comma-separated: lint,lint_slow,typecheck,test,test:unit,test:integration,test:e2e,maestro_e2e,playwright_e2e,format,build,dead_code,sg_scan,npm_security_scan,github_issue)'
|
|
98
103
|
required: false
|
|
99
104
|
default: ''
|
|
100
105
|
type: string
|
|
@@ -290,6 +295,45 @@ jobs:
|
|
|
290
295
|
NODE_OPTIONS: --max-old-space-size=6144
|
|
291
296
|
working-directory: ${{ inputs.working_directory || '.' }}
|
|
292
297
|
|
|
298
|
+
lint_slow:
|
|
299
|
+
name: 🐢 Slow Lint Rules
|
|
300
|
+
runs-on: ubuntu-latest
|
|
301
|
+
timeout-minutes: 20
|
|
302
|
+
if: ${{ !inputs.skip_lint_slow && !contains(inputs.skip_jobs, 'lint_slow') }}
|
|
303
|
+
|
|
304
|
+
steps:
|
|
305
|
+
- name: 📥 Checkout repository
|
|
306
|
+
uses: actions/checkout@v4
|
|
307
|
+
|
|
308
|
+
- name: 🔧 Setup Node.js
|
|
309
|
+
uses: actions/setup-node@v4
|
|
310
|
+
with:
|
|
311
|
+
node-version: ${{ inputs.node_version }}
|
|
312
|
+
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
313
|
+
|
|
314
|
+
- name: 🍞 Setup Bun
|
|
315
|
+
if: inputs.package_manager == 'bun'
|
|
316
|
+
uses: oven-sh/setup-bun@v2
|
|
317
|
+
with:
|
|
318
|
+
bun-version: latest
|
|
319
|
+
|
|
320
|
+
- name: 📥 Install dependencies
|
|
321
|
+
run: |
|
|
322
|
+
if [ "${{ inputs.package_manager }}" = "npm" ]; then
|
|
323
|
+
npm ci
|
|
324
|
+
elif [ "${{ inputs.package_manager }}" = "yarn" ]; then
|
|
325
|
+
yarn install --frozen-lockfile
|
|
326
|
+
elif [ "${{ inputs.package_manager }}" = "bun" ]; then
|
|
327
|
+
bun install --frozen-lockfile
|
|
328
|
+
fi
|
|
329
|
+
working-directory: ${{ inputs.working_directory || '.' }}
|
|
330
|
+
|
|
331
|
+
- name: 🐢 Run slow lint rules
|
|
332
|
+
run: ${{ inputs.package_manager }} run lint:slow
|
|
333
|
+
env:
|
|
334
|
+
NODE_OPTIONS: --max-old-space-size=6144
|
|
335
|
+
working-directory: ${{ inputs.working_directory || '.' }}
|
|
336
|
+
|
|
293
337
|
typecheck:
|
|
294
338
|
name: 🔍 Type Check
|
|
295
339
|
runs-on: ubuntu-latest
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: 🐢 Slow Lint Rules
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
schedule:
|
|
8
|
-
# Run nightly at 2 AM UTC
|
|
9
|
-
- cron: '0 2 * * *'
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
# Allow manual triggering
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
lint-slow:
|
|
15
|
-
name: 🐢 Slow Lint Rules
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
steps:
|
|
18
|
-
- name: 📥 Checkout
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- name: 📦 Setup Bun
|
|
22
|
-
uses: oven-sh/setup-bun@v2
|
|
23
|
-
with:
|
|
24
|
-
bun-version: latest
|
|
25
|
-
|
|
26
|
-
- name: 📦 Install dependencies
|
|
27
|
-
run: bun install --frozen-lockfile
|
|
28
|
-
|
|
29
|
-
- name: 🐢 Run slow lint rules
|
|
30
|
-
run: bun run lint:slow
|
|
31
|
-
|
|
32
|
-
create_issue_on_failure:
|
|
33
|
-
name: 📌 Create Issue on Failure
|
|
34
|
-
needs: [lint-slow]
|
|
35
|
-
if: ${{ failure() }}
|
|
36
|
-
uses: ./.github/workflows/create-issue-on-failure.yml
|
|
37
|
-
with:
|
|
38
|
-
workflow_name: 'Slow Lint Rules'
|
|
39
|
-
failed_job: 'lint-slow'
|
|
40
|
-
secrets: inherit
|