-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add Clang-Tidy GitHub Action Linter #171
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
base: main
Are you sure you want to change the base?
Conversation
|
Updated your branch with a rebase to keep it updated in prep for #165 |
.github/workflows/Linter.yml
Outdated
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang-tidy cmake ninja-build |
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.
These 3 pieces of software are installed by default on the ubuntu-latest runner you do not need to install them again see the docs for a list of other installed packages.
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.
I imagine as part of this you will find actual bugs in our codebase, when you do please document them to the best of your ability in a new GitHub issue for each, thanks!
|
Updating with rebase again |
|
Updated with rebase |
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Added steps to install dependencies and configure the build. Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Replaced clang-tidy-review actions with a direct clang-tidy command. Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Removed installation of clang-tidy and cmake from dependencies. Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Removed the 'Configure' step from the Linter workflow. Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Removed AnalyzeTemporaryDtors option from clang-tidy configuration. Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
Added a configuration step and improved clang-tidy invocation. Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: ReginaldWang <114448545+ReginaldWang@users.noreply.github.com>
|
I noticed your PR runs only on changed files (which seems reasonable) so I ran it over all of them and got... not good results What options are there? Is there a way to hide less important errors? I already filtered out |
dchansen06
left a comment
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.
May need to update the .clang-tidy or something else, I am not sure, but there are a lot of errors and warnings from the linter which is not good
To see them on the GitHub Action run
git ls-files '*.c' '*.h' | grep -v "Lib/Vendor" | xargs clang-tidy -p build/Debug| contents: read | ||
|
|
||
| jobs: | ||
| build: |
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.
| build: | |
| tidy: |
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.
Also please add a name like the other ones name: Clang-Tidy
|
|
||
| - name: Run clang-tidy | ||
| run: | | ||
| files=$(git diff --name-only origin/${{ github.base_ref }} | grep -E '\.(cpp|cc|cxx|c)$' || true) |
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.
For getting changed files please use an action like changed-files it is a bit cleaner
Can you for now please make it
- Auto fix what it can (and save changes)
- Fail the job on failure
| echo "No C/C++ source files changed" | ||
| exit 0 | ||
| fi | ||
| clang-tidy -p build $files |
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.
| clang-tidy -p build $files | |
| clang-tidy -p build/Debug $files |
| release: '12.2.Rel1' | ||
|
|
||
| - name: Configure | ||
| run: cmake --preset Debug |
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.
Is there a way to avoid linting on just one preset?
Clang-Tidy Linter
Problem and Scope
Meant to solve issue #163. Clang-tidy system is set up.
Description
Default clang-tidy file is added. Should cover most limitations of CodeQL. Github action is added (pretty simple, runs on pull request).
Gotchas and Limitations
I have no idea how it interacts with the other .yml files.
Testing
Testing Details
Larger Impact
Additional Context and Ticket