Skip to content

Commit 78d26ba

Browse files
committed
csfilter-kfp: handle lines consisting of white-spaces only
... as empty lines Related: https://issues.redhat.com/browse/OSH-755 Closes: #206
1 parent 12da743 commit 78d26ba

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/csfilter-kfp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def construct_path_filter(args):
113113
cmd += ' re=\n'
114114
cmd += ' while read line; do\n'
115115
cmd += ' re="${re}|(${line})"\n'
116-
cmd += ' done < <(grep -Esv \'^(#|$)\' "$ep")\n'
116+
cmd += ' done < <(grep -Esv \'^(#| *$)\' "$ep")\n'
117117
cmd += ' if test -n "$re"; then\n'
118118
cmd += ' csgrep --mode=json --invert-match --path="${re#|}"\n'
119119
cmd += ' else\n'

tests/csfilter-kfp/0002-stdout.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ path_filter() {
1313
re=
1414
while read line; do
1515
re="${re}|(${line})"
16-
done < <(grep -Esv '^(#|$)' "$ep")
16+
done < <(grep -Esv '^(#| *$)' "$ep")
1717
if test -n "$re"; then
1818
csgrep --mode=json --invert-match --path="${re#|}"
1919
else
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
WALinuxAgent[^/]*/dcr/.*
33
# dcr' is a testing pipeline for WALA and it is packaged by an oversight, the code is not used. It was removed in the current upstream so this will be gone with WALA rebase.
44

0 commit comments

Comments
 (0)