Copilot commented on code in PR #12926:
URL: https://github.com/apache/cloudstack/pull/12926#discussion_r3904634229
##########
.pre-commit-config.yaml:
##########
@@ -62,6 +62,16 @@ repos:
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
+ - id: insert-license
+ name: add license for all conf files
+ description: automatically adds a license header to all conf files
that don't have a license header
+ files: \.conf$
+ args:
+ - --comment-style
+ - '|#|'
+ - --license-filepath
+ - .github/workflows/license-templates/LICENSE.txt
+ - --fuzzy-match-generates-todo
- id: insert-license
Review Comment:
The hook applies to every `*.conf` in the repo (`files: \\.conf$`) but
forces `#` comment style for all of them. If any existing or future `.conf`
file uses a different comment syntax (common in some ini-like configs that
prefer `;`, or formats where `#` isn’t treated as a comment), the inserted
header can break parsing at runtime. Consider narrowing the `files:` regex to
the directories where `#` is confirmed valid, or splitting into multiple hooks
by directory/format with the appropriate `--comment-style` per group.
##########
.pre-commit-config.yaml:
##########
@@ -62,6 +62,16 @@ repos:
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
+ - id: insert-license
+ name: add license for all conf files
+ description: automatically adds a license header to all conf files
that don't have a license header
+ files: \.conf$
+ args:
+ - --comment-style
+ - '|#|'
+ - --license-filepath
+ - .github/workflows/license-templates/LICENSE.txt
+ - --fuzzy-match-generates-todo
Review Comment:
This adds another `insert-license` hook that duplicates the same argument
list pattern used by other license hooks (license template path + fuzzy match
behavior). To reduce drift (e.g., updating the license template path or flags
in one place but not others), consider using YAML anchors/aliases for the
shared `args` blocks, or otherwise centralizing the common arguments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]