Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] [pre-commit] Run yamllint in strict mode
@ 2026-08-27  6:56 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2026-08-27  6:56 UTC (permalink / raw)
  To: gdb-patches

While working on a patch series, I ran pre-commit in verbose mode and found
that yamllint showed a warning.

By default, yamllint runs in non-strict mode, so it doesn't return non-zero if
there are only warnings [1].

Consequently, the hook won't fail, and the warning will be hidden.

Fix this by running yamllint in strict mode.

[1] https://yamllint.readthedocs.io/en/stable/configuration.html#errors-and-warnings
---
 .pre-commit-config.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 53e4c5033c1..24d8ccad604 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -108,6 +108,11 @@ repos:
     hooks:
       - id: yamllint
         files: '^\.pre-commit-config.yaml$'
+        # By default warnings don't cause yamllint to return non-zero, so they:
+        # - don't cause the hook to fail, and
+        # - are hidden unless pre-commit runs in verbose mode.
+        # Enable strict mode to make sure we see and fix warnings.
+        args: [--strict]
 
   # Local hooks.
   - repo: local

base-commit: 4714939342d0bf5eac37455c13941a89013d004f
-- 
2.51.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-27  6:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27  6:56 [pushed] [pre-commit] Run yamllint in strict mode Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox