mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Merge 98aea48511 into 8416413a0e
This commit is contained in:
commit
3ebf851ac6
7 changed files with 553 additions and 0 deletions
5
testing/resources/bun-hook-repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/bun-hook-repo/.pre-commit-hooks.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
- id: test-bun-hook
|
||||
name: Test Bun Hook
|
||||
entry: test-bun-hook
|
||||
language: bun
|
||||
files: \.txt$
|
||||
16
testing/resources/bun-hook-repo/bin/test-hook.js
Executable file
16
testing/resources/bun-hook-repo/bin/test-hook.js
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env node
|
||||
// Simple test hook that validates file content
|
||||
const fs = require('fs');
|
||||
|
||||
const files = process.argv.slice(2);
|
||||
let failed = false;
|
||||
|
||||
files.forEach(file => {
|
||||
const content = fs.readFileSync(file, 'utf8');
|
||||
if (content.includes('bad')) {
|
||||
console.error(`Error in ${file}: contains 'bad'`);
|
||||
failed = true;
|
||||
}
|
||||
});
|
||||
|
||||
process.exit(failed ? 1 : 0);
|
||||
7
testing/resources/bun-hook-repo/package.json
Normal file
7
testing/resources/bun-hook-repo/package.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "test-bun-hook",
|
||||
"version": "1.0.0",
|
||||
"bin": {
|
||||
"test-bun-hook": "./bin/test-hook.js"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue