Skip to content

fix: strip export lines from ref files in pre-commit hook#15

Open
rickvian wants to merge 8 commits into
mainfrom
feature/add-more-approach
Open

fix: strip export lines from ref files in pre-commit hook#15
rickvian wants to merge 8 commits into
mainfrom
feature/add-more-approach

Conversation

@rickvian
Copy link
Copy Markdown
Owner

Summary

  • Fixed pre-commit hook (build_injected_file) to strip export lines from reference solution files before injecting them into the playground file
  • Without this fix, ref files that already contain export { fn }; (like 0424-longest-repeating-character-replacement.js) would produce a duplicate export statement, crashing the module and blocking every commit

Test plan

  • Stage a test file for a problem whose ref solution has an export line (e.g. 0424-longest-repeating-character-replacement)
  • Run git commit — hook should report OK instead of blocking with a module error
  • Verify the playground stub is restored after the hook runs

🤖 Generated with Claude Code

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