Skip to content

Commit

Permalink
fix: Adds "grep -P" to the list of banned commands (#1064)
Browse files Browse the repository at this point in the history
Co-authored-by: James Hegedus <jthegedus@hey.com>
  • Loading branch information
threkk and jthegedus committed Oct 6, 2021
1 parent 245f88d commit 8a515f4
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions test/banned_commands.bats
Expand Up @@ -3,25 +3,28 @@
load test_helpers

banned_commands=(
realpath
# readlink on OSX behaves differently from readlink on other Unix systems
readlink
# It's best to avoid eval as it makes it easier to accidentally execute
# arbitrary strings
eval
# Process substitution isn't POSIX compliant and cause trouble
"<("
# Command isn't included in the Ubuntu packages asdf depends on. Also not
# defined in POSIX
column
# does not work on alpine and should be grep -i either way
# echo isn't consistent across operating systems, and sometimes output can
# be confused with echo flags. printf does everything echo does and more.
echo
# It's best to avoid eval as it makes it easier to accidentally execute
# arbitrary strings
eval
# grep -y does not work on alpine and should be "grep -i" either way
"grep.* -y"
# grep -P is not a valid option in OSX.
"grep.* -P"
# realpath not available by default on OSX.
realpath
# readlink on OSX behaves differently from readlink on other Unix systems
readlink
# sort --sort-version isn't supported everywhere
"sort.*-V"
"sort.*--sort-versions"
# echo isn't consistent across operating systems, and sometimes output can
# be confused with echo flags. printf does everything echo does and more.
echo
# Process substitution isn't POSIX compliant and cause trouble
"<("
# source isn't POSIX compliant. . behaves the same and is POSIX compliant
source
)
Expand Down

0 comments on commit 8a515f4

Please sign in to comment.