From acd40009d97ab3c981c064a962944092be14b5c4 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 27 Jan 2025 02:27:02 -0500 Subject: [PATCH 1/4] Remove silent flag for better logging --- taskfiles/lint-cmake.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/taskfiles/lint-cmake.yaml b/taskfiles/lint-cmake.yaml index 87af4ba8..1c05ec01 100644 --- a/taskfiles/lint-cmake.yaml +++ b/taskfiles/lint-cmake.yaml @@ -16,7 +16,6 @@ tasks: vars: FLAGS: "--diff --color" - task: "gersemi" - silent: true vars: FLAGS: "--check" From d282bd8d3fd55a8d60d2743a9002ddee4db3edf2 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 27 Jan 2025 02:27:27 -0500 Subject: [PATCH 2/4] Remove --no-run-if-empty flag because it may fail on MacOS --- taskfiles/lint-cmake.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskfiles/lint-cmake.yaml b/taskfiles/lint-cmake.yaml index 1c05ec01..30a1545f 100644 --- a/taskfiles/lint-cmake.yaml +++ b/taskfiles/lint-cmake.yaml @@ -42,4 +42,4 @@ tasks: \( -path '**/build' -o -path '**/submodules' -o -path '**/tools' \) -prune -o \ \( -iname "CMakeLists.txt" -o -iname "*.cmake" -o -iname "*.cmake.in" \) \ -print0 | \ - xargs -0 --no-run-if-empty gersemi {{.FLAGS}} + xargs -0 gersemi {{.FLAGS}} From b8b17c7aaa15e9aece0b176baf0a8e6f430fd91d Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 27 Jan 2025 02:35:25 -0500 Subject: [PATCH 3/4] Prevent yaml linters from running unnecessarily --- taskfiles/lint-yaml.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/taskfiles/lint-yaml.yaml b/taskfiles/lint-yaml.yaml index 1f5adafc..223b7ad7 100644 --- a/taskfiles/lint-yaml.yaml +++ b/taskfiles/lint-yaml.yaml @@ -6,15 +6,23 @@ tasks: - "yaml-check" - "yaml-fix" desc: "Runs the YAML linters. Only checks for warnings and violations." + sources: + - "{{.ROOT_DIR}}/**/*.yaml" + - "{{.ROOT_DIR}}/**/*.yml" + - "{{.TASKFILE}}" + - exclude: "{{.ROOT_DIR}}/**/build/*" + - exclude: "{{.ROOT_DIR}}/**/submodules/*" + - exclude: "{{.ROOT_DIR}}/**/tools/*" deps: - "venv" dir: "{{.ROOT_DIR}}" cmds: - |- . "{{.G_LINT_VENV_DIR}}/bin/activate" - yamllint \ - --config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \ - --strict \ - .github \ - taskfile.yaml \ - taskfiles/ + find . \ + \( -path '**/build' -o -path '**/submodules' -o -path '**/tools' \) -prune -o \ + \( -iname "*.yml" -o -iname "*.yaml" \) \ + -print0 | \ + xargs -0 yamllint \ + --config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \ + --strict From 24c867760c899f3def5e6b267f839f39a726adf9 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 27 Jan 2025 02:39:52 -0500 Subject: [PATCH 4/4] Switch find order --- taskfiles/lint-yaml.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskfiles/lint-yaml.yaml b/taskfiles/lint-yaml.yaml index 223b7ad7..a15faa63 100644 --- a/taskfiles/lint-yaml.yaml +++ b/taskfiles/lint-yaml.yaml @@ -21,7 +21,7 @@ tasks: . "{{.G_LINT_VENV_DIR}}/bin/activate" find . \ \( -path '**/build' -o -path '**/submodules' -o -path '**/tools' \) -prune -o \ - \( -iname "*.yml" -o -iname "*.yaml" \) \ + \( -iname "*.yaml" -o -iname "*.yml" \) \ -print0 | \ xargs -0 yamllint \ --config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \