mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Update banned_commands.bats tests to ignore string literals
This commit is contained in:
parent
4dbe88a62a
commit
79eca42572
@ -38,10 +38,12 @@ teardown() {
|
||||
for cmd in "${banned_commands[@]}"; do
|
||||
# Assert command is not used in the lib and bin dirs
|
||||
# or expect an explicit comment at end of line, allowing it.
|
||||
# Also ignore matches that are contained in comments or followed by an
|
||||
# underscore (indicating it's a variable and not a command).
|
||||
# Also ignore matches that are contained in comments or a string or
|
||||
# followed by an underscore (indicating it's a variable and not a
|
||||
# command).
|
||||
run bash -c "grep -nHR '$cmd' lib bin\
|
||||
| grep -v '#.*$cmd'\
|
||||
| grep -v '\".*$cmd.*\"' \
|
||||
| grep -v '${cmd}_'\
|
||||
| grep -v '# asdf_allow: $cmd'"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user