[Bug build/34295] [gdb/build] Make pre-commit config file more maintainable
"cvs-commit at gcc dot gnu.org via Gdb-prs" <[email protected]>
| Newsgroups | gmane.comp.gdb.bugs.discuss |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://sourceware.org/bugzilla/show_bug.cgi?id=34295 --- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tom de Vries <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2b28c50ecd058b3fe0328d1bf5f7bc06fd8ca41c commit 2b28c50ecd058b3fe0328d1bf5f7bc06fd8ca41c Author: Tom de Vries <[email protected]> Date: Mon Jul 13 13:11:06 2026 +0200 [pre-commit] Remove duplication in config file In a recent commit, I introduced anchor/alias pairs in .pre-commit-config.yaml, with short non-descriptive names for local use: ... - - id: check-include-guards - name: check-include-guards + - id: &id0 check-include-guards + name: *id0 ... Use anchors and aliases a bit more to remove duplication, now using more descriptive names for non-local uses. Yaml also supports defining an anchor for more than one field, which result in cleaner code: ... +python-files: &python-files + types_or: [file] + files: '^gdb/.*\.py(\.in)?$' + ... - id: black - types_or: [file] - files: '^gdb/.*\.py(\.in)?$' + <<: *python-files ... but unfortunately pre-commit generates a warning "[WARNING] Unexpected key(s) present at root: python-files" for this [1]. Also add a default files setting. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34295 [1] https://github.com/pre-commit/pre-commit/issues/1481 -- You are receiving this mail because: You are on the CC list for the bug.