pre-commit header license checker with auto population
This commit is contained in:
parent
68ced830d7
commit
92fe178519
2 changed files with 9 additions and 2 deletions
|
@ -27,7 +27,7 @@ repos:
|
||||||
- id: check-shebang-scripts-are-executable
|
- id: check-shebang-scripts-are-executable
|
||||||
exclude: "\\.mustache$"
|
exclude: "\\.mustache$"
|
||||||
- repo: https://github.com/Quard/license-header-checker
|
- repo: https://github.com/Quard/license-header-checker
|
||||||
rev: v0.1
|
rev: v0.2.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: license-header-checker
|
- id: license-header-checker
|
||||||
files: \.(c|h|dtsi|dts|overlay|keymap)$
|
files: \.(c|h|dtsi|dts|overlay|keymap)$
|
||||||
|
@ -37,6 +37,8 @@ repos:
|
||||||
- "/*| *| */"
|
- "/*| *| */"
|
||||||
- --license
|
- --license
|
||||||
- "\\nCopyright \\(c\\) \\d{4}(-\\d{4})? The ZMK Contributors\\n\\nSPDX-License-Identifier: MIT\\n"
|
- "\\nCopyright \\(c\\) \\d{4}(-\\d{4})? The ZMK Contributors\\n\\nSPDX-License-Identifier: MIT\\n"
|
||||||
|
- --auto-populate
|
||||||
|
- .pre-commit/license_header.tmpl
|
||||||
- id: license-header-checker
|
- id: license-header-checker
|
||||||
files: (\.yaml)|(CMakeLists.txt)|(Kconfig)$
|
files: (\.yaml)|(CMakeLists.txt)|(Kconfig)$
|
||||||
exclude: ^((app/boards/)|(app/tests/)|(\.pre-commit-config.yaml))
|
exclude: ^((app/boards/)|(app/tests/)|(\.pre-commit-config.yaml))
|
||||||
|
@ -44,4 +46,6 @@ repos:
|
||||||
- --comment-style
|
- --comment-style
|
||||||
- "#"
|
- "#"
|
||||||
- --license
|
- --license
|
||||||
- "Copyright \\(c\\) \\d{4}(-\\d{4})? The ZMK Contributors\\nSPDX-License-Identifier: MIT"
|
- "\\s*Copyright \\(c\\) \\d{4}(-\\d{4})? The ZMK Contributors\\n\\s*SPDX-License-Identifier: MIT"
|
||||||
|
- --auto-populate
|
||||||
|
- .pre-commit/license_header.tmpl
|
||||||
|
|
3
.pre-commit/license_header.tmpl
Normal file
3
.pre-commit/license_header.tmpl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Copyright (c) {YEAR} The ZMK Contributors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: MIT
|
Loading…
Add table
Reference in a new issue