mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
refactor: address reviewer feedback
- Add options={} parameter to run() to match run-with-flags.js contract
- Remove case-insensitive flag from extension pre-filter for consistency
with ADHOC_FILENAMES regex (both now case-sensitive)
- Expand warning text to list more structured paths
- Add test cases for uppercase extensions (TODO.MD, NOTES.TXT)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Lidang-Jiang <lidangjiang@gmail.com>
This commit is contained in:
parent
27d71c9548
commit
3c3781ca43
2 changed files with 7 additions and 5 deletions
|
|
@ -28,8 +28,8 @@ function isSuspiciousDocPath(filePath) {
|
|||
const normalized = filePath.replace(/\\/g, '/');
|
||||
const basename = path.basename(normalized);
|
||||
|
||||
// Only inspect .md and .txt files
|
||||
if (!/\.(md|txt)$/i.test(basename)) return false;
|
||||
// Only inspect .md and .txt files (case-sensitive, consistent with ADHOC_FILENAMES)
|
||||
if (!/\.(md|txt)$/.test(basename)) return false;
|
||||
|
||||
// Only flag known ad-hoc filenames
|
||||
if (!ADHOC_FILENAMES.test(basename)) return false;
|
||||
|
|
@ -44,7 +44,7 @@ function isSuspiciousDocPath(filePath) {
|
|||
* Exportable run() for in-process execution via run-with-flags.js.
|
||||
* Avoids the ~50-100ms spawnSync overhead when available.
|
||||
*/
|
||||
function run(inputOrRaw) {
|
||||
function run(inputOrRaw, options = {}) {
|
||||
let input;
|
||||
try {
|
||||
input = typeof inputOrRaw === 'string'
|
||||
|
|
@ -61,7 +61,7 @@ function run(inputOrRaw) {
|
|||
stderr:
|
||||
'[Hook] WARNING: Ad-hoc documentation filename detected\n' +
|
||||
`[Hook] File: ${filePath}\n` +
|
||||
'[Hook] Consider using structured paths: docs/, .claude/commands/, skills/',
|
||||
'[Hook] Consider using a structured path (e.g. docs/, .claude/, skills/, .github/, benchmarks/, templates/)',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue