Add allowlist for hardcoded URL checker#69
Conversation
8d6c9d8
into
codex/create-hardcoded-url-check-script
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| matches=$(grep -R --line-number --exclude-dir=node_modules --exclude-dir=.git -E "http://localhost|localhost:5000" || true) | ||
| matches=$(echo "$matches" | grep -v 'scripts/list-hardcoded-urls.sh' || true) | ||
|
|
||
| if [[ -f "$ALLOWLIST_FILE" ]]; then |
There was a problem hiding this comment.
[P1] Filter only file paths when applying allowlist
The allowlist is applied with grep -F -v -f "$ALLOWLIST_FILE" against the entire file:line:content string produced by the previous grep. This causes false negatives when the line’s contents mention any string from the allowlist even if the file itself is not allowlisted (for instance, a comment that says “see README.md” and also contains a new http://localhost URL). In such cases the checker silently drops the match and will not fail the build, defeating the purpose of the safeguard. Filtering should be applied solely to the path portion before the first colon.
Useful? React with 👍 / 👎.
Summary
scripts/hardcoded-url-allowlist.txtTesting
./scripts/list-hardcoded-urls.shnpm test(backend)npm test(frontend)`https://chatgpt.com/codex/tasks/task_e_68b4cfc741388321a48faf1f551e700f