-
Notifications
You must be signed in to change notification settings - Fork 10
feat(lint): Add tasks for linting C++ files with clang-tidy; Refactor tasks for linting C++ files (resolves #64). #125
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e381d4c
ci: Add tasks for linting with clang-tidy.
davidlion 6032e98
git mistake
davidlion 1caca4b
Add BufferParser.hpp to exclude list for macos.
davidlion e4efbfa
Remove check-cmake.
davidlion d1560fb
Update yaml lint naming.
davidlion 3626dbe
Add ReaderParser.hpp to exclude list for macos.
davidlion 7683363
Merge branch 'main' into clang-tidy
davidlion aaa4b04
Merge branch 'main' into clang-tidy
davidlion 13f0bd7
Add more files to exclude.
davidlion 7953b1f
Merge branch 'main' into clang-tidy
davidlion 1d2b8e5
Rename lint.yml to lint.yaml.
davidlion 27f5e32
clang-tidy workaround
davidlion c8fca75
Add sudo.
davidlion af32abd
Fix to clang-20.
davidlion 1523731
Merge remote-tracking branch 'upstream/main' into clang-tidy
davidlion 02ad628
Build tasks working. Examples tasks need refactor.
davidlion 49f7c25
Refactor examples.
davidlion b93fb26
Merge remote-tracking branch 'upstream/main' into clang-tidy
davidlion 9c7c838
Update lint.yaml, running with failures.
davidlion f331277
Bump dev-utils.
davidlion dbc6663
Build compile_commands for exampels by default.
davidlion e7e747f
lint task overhaul.
davidlion da54c57
Fix common files in examples so clang-tidy doesn't fail with all exam…
davidlion c8ba98c
Fix check-cpp-static-log-surgeon alias.
davidlion 834aea1
Undo yml rename for this PR.
davidlion 158543d
Remove old script.
davidlion 1753510
add uv to workflows.
davidlion 4428af4
Update readme.
davidlion 802911c
Fix args size.
davidlion 0a0e3de
Fix build issue maybe related to clang 20.1.8 vs 20.1.6.
davidlion 9d07d11
autocomplete too lit.
davidlion 3ba6934
Merge remote-tracking branch 'upstream/main' into clang-tidy
davidlion f25da50
Merge branch 'main' into clang-tidy
davidlion 2698e1d
Fix merge mistake.
davidlion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ Requirements: | |
| * [fmt] >= 8.0.1 | ||
| * [GSL] >= 4.0.0 | ||
| * [Task] >= 3.38 | ||
| * [uv] >= 0.7.10 | ||
|
Comment on lines
90
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to reflect the llvm clang-tidy 20 install? |
||
|
|
||
| To build and install the project to `$HOME/.local`: | ||
|
|
||
|
|
@@ -153,45 +154,15 @@ is set to true and unit tests are built. | |
| Before submitting a PR, ensure you've run our linting tools and either fixed any violations or | ||
| suppressed the warning. | ||
|
|
||
| ### Requirements | ||
|
|
||
| We currently support running our linting tools on Linux and macOS. If you're developing on another | ||
| OS, you can submit a [feature request][feature-req]. If you can't run the linting workflows | ||
| locally, you can enable and run the [lint] workflow in your fork. | ||
|
|
||
| To run the linting tools, besides commonly installed tools like `tar`, you'll need: | ||
|
|
||
| * [clang-tidy] | ||
| * `md5sum` | ||
| * Python 3.8 or newer | ||
| * python3-venv | ||
| * [Task] | ||
|
|
||
| ### Setup | ||
|
|
||
| ```shell | ||
| ./tools/init.sh | ||
| ``` | ||
|
|
||
| ### Running the linters | ||
|
|
||
| Currently, `clang-tidy` has to be run manually: | ||
|
|
||
| ```shell | ||
| find src tests \ | ||
| -type f \ | ||
| \( -iname "*.cpp" -o -iname "*.hpp" \) \ | ||
| -print0 | \ | ||
| xargs -0 clang-tidy --config-file .clang-tidy -p build | ||
| ``` | ||
|
|
||
| To report all errors run: | ||
| To report all errors, run: | ||
|
|
||
| ```shell | ||
| task lint:check | ||
| ``` | ||
|
|
||
| To fix cpp errors, and report yaml errors, run: | ||
| To automatically fix any supported format or linting errors, run: | ||
|
|
||
| ```shell | ||
| task lint:fix | ||
|
|
@@ -217,9 +188,8 @@ The following are issues we're aware of and working on: | |
|
|
||
| [bug-report]: https://github.com/y-scope/log-surgeon/issues/new?assignees=&labels=bug&template=bug-report.yaml | ||
| [Catch2]: https://github.com/catchorg/Catch2/tree/devel | ||
| [clang-tidy]: https://clang.llvm.org/extra/clang-tidy/ | ||
| [feature-req]: https://github.com/y-scope/log-surgeon/issues/new?assignees=&labels=enhancement&template=feature-request.yaml | ||
| [fmt]: https://github.com/fmtlib/fmt | ||
| [GSL]: https://github.com/microsoft/GSL | ||
| [lint]: https://github.com/y-scope/log-surgeon/blob/main/.github/workflows/lint.yaml | ||
| [Task]: https://taskfile.dev/ | ||
| [uv]: https://docs.astral.sh/uv | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This doesn't match the version being installed. Is it suppose to be 0.8.4?
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.
It should reflect the minimum required version to work (uv in-particular is inherited from dev-utils). For CI we just use the latest stable so that we pick up any new changes. Ideally, we tested both sides (minimum and maximum versions), but it is awkward to setup.