[3/4] Add check-include-guards.py to pre-commit
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
This changes pre-commit to run check-include-guards.py.
---
.pre-commit-config.yaml | 7 +++++++
1 file changed, 7 insertions(+)
Comments
On 2024-04-17 18:05, Tom Tromey wrote:
> This changes pre-commit to run check-include-guards.py.
> ---
> .pre-commit-config.yaml | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
> index 8721dac678b..b3dcf6482cf 100644
> --- a/.pre-commit-config.yaml
> +++ b/.pre-commit-config.yaml
> @@ -22,3 +22,10 @@ repos:
> - id: isort
> types_or: [file]
> files: 'gdb/.*\.py(\.in)?$'
> + - repo: local
> + hooks:
> + - id: check-include-guards
> + name: check-include-guards
> + language: python
> + entry: gdb/check-include-guards.py
> + files: '^(gdb(support|server)?)/[^/]*(/[^/]*)?\.h$'
The regex is a bit hard to read... can you add a comment to indicate
what this indends to match? I think this does not match header files
under gdb/testsuite (because they are deeper than what the regex would
match)?
Simon
Simon> The regex is a bit hard to read... can you add a comment to indicate
Simon> what this indends to match? I think this does not match header files
Simon> under gdb/testsuite (because they are deeper than what the regex would
Simon> match)?
I added this:
# This matches headers in gdbsupport, gdbserver, gdb, and the
# immediate subdirectories of gdb (e.g., gdb/nat) -- but,
# importantly, not gdb/testsuite/*/*.h.
I went a little too fast sending v2, should have waited a bit.
Anyway I don't think this addition warrants a v3.
Tom
@@ -22,3 +22,10 @@ repos:
- id: isort
types_or: [file]
files: 'gdb/.*\.py(\.in)?$'
+ - repo: local
+ hooks:
+ - id: check-include-guards
+ name: check-include-guards
+ language: python
+ entry: gdb/check-include-guards.py
+ files: '^(gdb(support|server)?)/[^/]*(/[^/]*)?\.h$'