Skip to content

chore: delete dead JS scripts with hardcoded personal paths; extend path guard to .js - #201

Open
gadievron wants to merge 1 commit into
knostic:masterfrom
gadievron:chore/purge-hardcoded-js-paths
Open

chore: delete dead JS scripts with hardcoded personal paths; extend path guard to .js#201
gadievron wants to merge 1 commit into
knostic:masterfrom
gadievron:chore/purge-hardcoded-js-paths

Conversation

@gadievron

Copy link
Copy Markdown
Collaborator

What

Delete two dead JavaScript scripts that ship hardcoded personal paths, and extend the machine-path guard to .js/.ts so this class can't recur.

Why

Found while auditing merged PRs whose CI had failed on the same hardcoded-scratch-path class. tests/test_no_hardcoded_paths.py sweeps *.py only, so two orphaned JS scripts carrying /Users/nahumkorda/... shipped undetected:

  • parsers/javascript/generate_report.js — a run-only script (top-level readFileSync of an absolute path), no exports, no callers.
  • parsers/javascript/dataset_enhancer.js — an unreachable orphaned duplicate of the live, imported+tested parsers/python/dataset_enhancer.py (no module.exports, no requirer, no npm/CI/subprocess invocation).

How

  • Delete both JS files.
  • Extend the guard's shipped-source sweep to .js/.ts (strip // comments, anti-vacuous floor >= 3, JS self-test line).
  • gitignore /bughunt-repros/ (a local scratch dir carrying personal paths).

Tests

tests/test_no_hardcoded_paths.py: 405 passed (now including the 6 surviving shipped JS files). JS parser + multi-language suites: 236 passed — the deletions break nothing (no importers).

Compatibility

None — both files are unreachable dead code; the live parser path is unaffected.

Note for maintainers

The deeper cause behind this class: ~30 PRs merged with red CI on the same hardcoded-path failures (later healed on master). Consider branch protection on master — require the CI check green before merge and disable admin override-merge on red — so a green guard actually gates the merge.

…ath guard to .js

Two orphaned JavaScript scripts shipped hardcoded personal paths
(/Users/nahumkorda/...) that the machine-path guard never caught because it
swept *.py only:
- parsers/javascript/generate_report.js — a run-only script (top-level
  readFileSync of an absolute path), no exports, no callers.
- parsers/javascript/dataset_enhancer.js — an orphaned duplicate of the live,
  imported+tested Python parsers/python/dataset_enhancer.py; unreachable
  (no module.exports, no requirer, no npm/CI/subprocess invocation).

Both deleted. tests/test_no_hardcoded_paths.py's shipped-source sweep now also
covers .js/.ts (stripping // comments, with an anti-vacuous floor + JS
self-test) so this class can't recur. Also gitignore /bughunt-repros/ (a local
scratch dir that carries personal paths).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant