-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add cpp-linter action #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@seiko2plus do you think this is good enough, or do you think we should set up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a C++ linting step to CI and ensures consistent formatting with NumPy’s .clang-format
.
- Introduces a GitHub Actions workflow (
cpp-linter.yml
) that runs a C++ linter on changes undernpsr/
. - Adds a
.clang-format
file mirroring NumPy’s style for uniform code formatting.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
.github/workflows/cpp-linter.yml | New CI workflow to run a C++ linter via the cpp-linter-action . |
.clang-format | Clang-Format configuration based on NumPy’s style guidelines. |
Comments suppressed due to low confidence (1)
.clang-format:28
- The regex for matching angled includes uses a closing quote (
"
) instead of a closing angle bracket (>
). It should be^<[[:alnum:]_.]+>
to properly match<header>
patterns.
- Regex: '^<[[:alnum:]_.]+'"
style: "file" | ||
|
||
- name: Linter Outputs | ||
if: steps.linter.outputs.checks-failed != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions outputs are treated as strings; comparing checks-failed
to an unquoted number may always evaluate to true. Use != '0'
or compare as a string to correctly detect failures.
if: steps.linter.outputs.checks-failed != 0 | |
if: steps.linter.outputs.checks-failed != '0' |
Copilot uses AI. Check for mistakes.
This uses the same .clang-format as numpy for consistency.
I followed google style without any modifications in #1 to match with Highway, but its okay to reformat it.. I just followed Highway because I thought that's maybe its better to target Highway community in case of there's need to move/share any code.. |
For now its fine to me.. I just add it spin within #1, with support of spin commands ( |
@Mousius, Thank you! |
This uses the same .clang-format as numpy for consistency.