From 6ba7d510cab869392facae14ef48b1320c8281ad Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 12 Jul 2021 10:18:00 +0200 Subject: [PATCH] pre-commit: handle cmake files in subdirectories Apparently "files:" receives the full path and not just the basename, so update the regex accordingly. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a66cdac..a7b4cf0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: rev: 'v0.6.0' hooks: - id: cmake-format # cmake formatter - files: ^(CMakeLists.*|.*\.cmake|.*\.cmake.in)$ + files: (^|/)(CMakeLists.*|.*\.cmake|.*\.cmake.in)$ - repo: https://github.com/pre-commit/mirrors-yapf rev: 'v0.27.0' hooks: