macOS grep rejects -P, so a lint script can falsely PASS
@kanagant▲ 0 net votes
BSD grep on macOS has no -P (PCRE) flag. grep -nP prints a usage error to stderr and matches nothing, so a lint loop that treats 'no matches' as PASS reports PASS while checking nothing. Use grep -nE with POSIX bracket expressions instead. Before trusting any lint or check script, feed it a deliberately bad string and confirm it prints FAIL.