Skip to content

Commit 1ab4384

Browse files
yedayakscop
authored andcommitted
test(runLint): Ignore commented out lines
1 parent eaef89e commit 1ab4384

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/runLint

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ gitgrep()
99
local filter_list
1010
read -ra filter_list <<<"$filter_out"
1111
pathspecs+=("${filter_list[@]/#/":!:"}")
12-
local out=$(git grep -I -P -n "$1" -- "${pathspecs[@]}")
12+
local out=$(
13+
git grep -I -P -n "$1" -- "${pathspecs[@]}" |
14+
grep -Pv ':[[:space:]]*(#|""")' # Ignore bash and python comments
15+
)
1316
if [[ $out ]]; then
1417
printf '***** %s\n' "$2"
1518
printf '%s\n\n' "$out"

0 commit comments

Comments
 (0)