From 35e51464f0eed31783a50d131613efe62f865dc2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 10 Nov 2026 16:30:12 +0100 Subject: [PATCH] tools: enable strict mode for yamllint Treats warnings as errors, so we can detect regressions. Signed-off-by: Antoine du Hamel --- .github/workflows/nix-changes.yml | 2 +- Makefile | 4 +++- test/fixtures/test426/.github/workflows/ci.yml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nix-changes.yml b/.github/workflows/nix-changes.yml index 713e740e2701..779644689150 100644 --- a/.github/workflows/nix-changes.yml +++ b/.github/workflows/nix-changes.yml @@ -50,7 +50,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 2 - persist-credentials: true # We need read access in case we need to fetch in `Compute requisites before change` step + persist-credentials: true # We need read access in case we need to fetch in `Compute requisites before change` step sparse-checkout: | shell.nix tools/nix/ diff --git a/Makefile b/Makefile index fbf6f3f5323a..fa6979120dce 100644 --- a/Makefile +++ b/Makefile @@ -1715,15 +1715,17 @@ endif # python -m pip install yamllint # Try with '--system' if it fails without; the system may have set '--user' lint-yaml-build: ## Build resources needed to lint YAML files. +ifeq ($(YAMLLINT), tools/pip/site-packages/bin/yamllint) $(info Pip installing yamllint on $(shell $(PYTHON) --version)...) $(PYTHON) -m pip install --upgrade -t tools/pip/site-packages yamllint || \ $(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages yamllint +endif .PHONY: lint-yaml ifneq ("","$(wildcard $(YAMLLINT))") lint-yaml: ## Lint the YAML files with yamllint. $(info Running YAML linter...) - PYTHONPATH=tools/pip $(YAMLLINT) . + PYTHONPATH=tools/pip $(YAMLLINT) --strict . else lint-yaml: $(warning YAML linting with yamllint is not available) diff --git a/test/fixtures/test426/.github/workflows/ci.yml b/test/fixtures/test426/.github/workflows/ci.yml index 72d33dddb54c..0eb2f29f8573 100644 --- a/test/fixtures/test426/.github/workflows/ci.yml +++ b/test/fixtures/test426/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - id-token: write # for npm trusted publishing + id-token: write # for npm trusted publishing concurrency: group: npm-publish cancel-in-progress: false