Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adds "grep -P" to the list of banned commands #1064

Merged
merged 3 commits into from Oct 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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