Skip to content

Commit 0406024

Browse files
surpradhanclaude
andcommitted
fix: use exact word boundary in built-in module check
grep -q "^re" was matching 'requests' since it starts with 're'. Use a regex that requires the module name to be followed by a version specifier, whitespace, or end-of-line. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 626c949 commit 0406024

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
108108
# Check for built-in modules listed as dependencies
109109
for builtin in ast difflib json re sys os subprocess; do
110-
if grep -q "^$builtin" requirements*.txt; then
110+
if grep -qE "^${builtin}([[:space:]>=<!]|$)" requirements*.txt; then
111111
echo "Error: $builtin is a built-in module, should not be in requirements"
112112
exit 1
113113
fi

0 commit comments

Comments
 (0)