mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: exact byte pass-through in post-edit-console-warn, add 7 tests
Replace console.log(data) with process.stdout.write(data) in both pass-through paths to prevent appending a trailing newline that corrupts the hook output. Add 7 tests covering exact byte fidelity, malformed JSON, missing file_path, non-existent files, exclusion patterns in check-console-log, non-git repo handling, and empty stdin.
This commit is contained in:
parent
f4758ff8f0
commit
6bbcbec23d
2 changed files with 68 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ process.stdin.on('end', () => {
|
|||
|
||||
if (filePath && /\.(ts|tsx|js|jsx)$/.test(filePath)) {
|
||||
const content = readFile(filePath);
|
||||
if (!content) { console.log(data); return; }
|
||||
if (!content) { process.stdout.write(data); return; }
|
||||
const lines = content.split('\n');
|
||||
const matches = [];
|
||||
|
||||
|
|
@ -48,5 +48,5 @@ process.stdin.on('end', () => {
|
|||
// Invalid input — pass through
|
||||
}
|
||||
|
||||
console.log(data);
|
||||
process.stdout.write(data);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue