Skip to content

Commit b8b17c7

Browse files
committed
Prevent yaml linters from running unnecessarily
1 parent d282bd8 commit b8b17c7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

taskfiles/lint-yaml.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ tasks:
66
- "yaml-check"
77
- "yaml-fix"
88
desc: "Runs the YAML linters. Only checks for warnings and violations."
9+
sources:
10+
- "{{.ROOT_DIR}}/**/*.yaml"
11+
- "{{.ROOT_DIR}}/**/*.yml"
12+
- "{{.TASKFILE}}"
13+
- exclude: "{{.ROOT_DIR}}/**/build/*"
14+
- exclude: "{{.ROOT_DIR}}/**/submodules/*"
15+
- exclude: "{{.ROOT_DIR}}/**/tools/*"
916
deps:
1017
- "venv"
1118
dir: "{{.ROOT_DIR}}"
1219
cmds:
1320
- |-
1421
. "{{.G_LINT_VENV_DIR}}/bin/activate"
15-
yamllint \
16-
--config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \
17-
--strict \
18-
.github \
19-
taskfile.yaml \
20-
taskfiles/
22+
find . \
23+
\( -path '**/build' -o -path '**/submodules' -o -path '**/tools' \) -prune -o \
24+
\( -iname "*.yml" -o -iname "*.yaml" \) \
25+
-print0 | \
26+
xargs -0 yamllint \
27+
--config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \
28+
--strict

0 commit comments

Comments
 (0)