add pre-commit plugin to check of license header in source files, fixes #562

This commit is contained in:
Vadym Zakovinko 2023-02-24 21:14:05 +02:00
parent 5aac2743b1
commit 68ced830d7
No known key found for this signature in database
GPG key ID: 1250E1F033D1ED46

View file

@ -26,3 +26,22 @@ repos:
- id: check-added-large-files
- id: check-shebang-scripts-are-executable
exclude: "\\.mustache$"
- repo: https://github.com/Quard/license-header-checker
rev: v0.1
hooks:
- id: license-header-checker
files: \.(c|h|dtsi|dts|overlay|keymap)$
exclude: ^((app/boards/)|(app/tests/))
args:
- --comment-style
- "/*| *| */"
- --license
- "\\nCopyright \\(c\\) \\d{4}(-\\d{4})? The ZMK Contributors\\n\\nSPDX-License-Identifier: MIT\\n"
- id: license-header-checker
files: (\.yaml)|(CMakeLists.txt)|(Kconfig)$
exclude: ^((app/boards/)|(app/tests/)|(\.pre-commit-config.yaml))
args:
- --comment-style
- "#"
- --license
- "Copyright \\(c\\) \\d{4}(-\\d{4})? The ZMK Contributors\\nSPDX-License-Identifier: MIT"