mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
Implements Bun as a new language option for pre-commit hooks, enabling hooks to run using the Bun JavaScript runtime and package manager. - Add bun.py language implementation with binary download/install - Support system-installed Bun or automatic version download - Add comprehensive tests including version handling and hook execution - Register bun in all_languages.py - Include test repository fixture for integration tests
16 lines
372 B
JavaScript
Executable file
16 lines
372 B
JavaScript
Executable file
#!/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);
|