Skip to content

Commit 394c02e

Browse files
committed
tests: yamllint: descend into the relevant dir
Descend into the dir where the file is, that way local .yamllint files are taken into account. yamllint searches for configs down the fs chain but only from CWD location. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 00851a7 commit 394c02e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/patch/yamllint/yamllint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ git checkout -q HEAD~
3232

3333
# Also ignore created, as not present in the parent commit
3434
for f in $(git show --diff-filter=M --pretty="" --name-only "${HEAD}" | grep -E "\.yaml$"); do
35-
yamllint "$f" | tee -a "$tmpfile_o"
35+
(
36+
cd "$(dirname "$f")" || exit 1
37+
38+
yamllint "$(basename "$f")" | tee -a "$tmpfile_o"
39+
)
3640
done
3741

3842
incumbent=$(grep -i -c " error " "$tmpfile_o")
@@ -42,7 +46,11 @@ pr "Checking the tree with the patch"
4246
git checkout -q "$HEAD"
4347

4448
for f in $(git show --diff-filter=AM --pretty="" --name-only "${HEAD}" | grep -E "\.yaml$"); do
45-
yamllint "$f" | tee -a "$tmpfile_n"
49+
(
50+
cd "$(dirname "$f")" || exit 1
51+
52+
yamllint "$(basename "$f")" | tee -a "$tmpfile_n"
53+
)
4654
done
4755

4856
current=$(grep -i -c " error " "$tmpfile_n")

0 commit comments

Comments
 (0)