Skip to content

Commit 4b5c016

Browse files
committed
Fix RuboCop error and improve validation logic
- Remove redundant backslash escape in .py regex - Change validation from AND to OR (more correct logic) - Improve error message to mention 'readable' file
1 parent f125de6 commit 4b5c016

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packaging/homebrew/mfc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def install
145145
fi
146146
147147
# Require a readable Python file (not a directory)
148-
if [[ ! "${first_nonflag}" =~ \.py$ ]] || [[ ! -f "${first_nonflag}" ]]; then
148+
if [[ ! "${first_nonflag}" =~ .py$ ]] || [[ ! -f "${first_nonflag}" ]]; then
149149
echo "mfc (Homebrew): first argument must be a readable Python case file."
150150
echo "Given: ${first_nonflag}"
151151
echo "Usage: mfc <case.py> [options]"

0 commit comments

Comments
 (0)