Add a cmakelint GitHub action#67
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new GitHub Actions workflow to automatically lint CMake files in the repository using cmake-lint. The workflow runs on pull requests and checks all CMakeLists.txt and *.cmake files for style and formatting issues.
Key changes:
- Adds a new
.github/workflows/cmake-lint.ymlworkflow file that runs cmake-lint on pull requests - Sets up Python virtual environment and installs cmake-lint
- Finds and lints all CMake files in the repository
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Okay, this sets up cmake-lint correctly and runs it. I'm going to mark it as a draft until the CMake cleanup gets in. At that point, this should pass and I'll rebase it. |
c6e6c51 to
6475a5a
Compare
6475a5a to
456c4f2
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
456c4f2 to
a5b63e8
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
86f9287 to
08592ff
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
So the cmakelint action is prompted to run
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fi | ||
| echo "Linting the following files:" | ||
| echo "$FILES" | ||
| cmakelint $FILES |
There was a problem hiding this comment.
The command cmakelint $FILES will fail if any file paths contain spaces because FILES is not quoted. This causes word splitting. Use cmakelint $FILES with proper quoting or pass files via xargs to handle paths with spaces correctly.
| cmakelint $FILES | |
| # Use find -print0 and xargs -0 to handle file paths with spaces | |
| find . -type f \( -name "CMakeLists.txt" -o -name "*.cmake" \) -print0 | xargs -0 cmakelint |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NOTE:
cmakelint, notcmake-lint!!!