-
Notifications
You must be signed in to change notification settings - Fork 62
Add clang-tidy config and associated fixes #1146
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
Open
hikinggrass
wants to merge
55
commits into
main
Choose a base branch
from
bugfix/clang-tidy-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
e27213e
Add clang-tidy config
hikinggrass bd0fc78
Fix clang-format config to always keep qualifiers aligned left
hikinggrass dc9d31a
Update gitignore file
hikinggrass 2612ee1
Fix doxygen comment formatting on generated files
hikinggrass 84bec6d
Fix header guard
hikinggrass c6716b3
Use const refs in generated messages and types
hikinggrass ade4503
Use const (ref) where possible
hikinggrass 0da2471
Use explicit comparisons in if statements and prefer empty() to size(…
hikinggrass 5abbbfc
Use = default for ctors and use override for virtual functions
hikinggrass af0de49
Use ctor initializer list
hikinggrass 4514ecf
Do not declare multiple variables at once
hikinggrass a089d90
Initialize members and variables
hikinggrass 9a39eb0
Use using instead of typedef
hikinggrass e6d200e
Simplify if/else handling, eg. no use of else after return
hikinggrass 2578082
Use stoul instead of atoi
hikinggrass c162d3e
Fix missing value in enum declaration
hikinggrass 41d1032
Add clamp_to and convert_to_positive_size_t utils functions
hikinggrass 6d12cfd
Use anonymous namespace instead of static
hikinggrass 1a8909c
Use enum class instead of enum
hikinggrass f870412
remove repeating visibilities
hikinggrass 8eb99ea
Fix parameter names not being identical in hpp and cpp
hikinggrass e855c0c
remove redundant inline
hikinggrass 1f1f748
Access static member via class not this
hikinggrass 6d0606a
Use move
hikinggrass 0e90f07
Make log_on_fail static
hikinggrass 102cd08
Fix size_t usage in profile
hikinggrass 7e2797b
Fix includes
hikinggrass e00d560
Use std::is_same_v
hikinggrass 6d46530
Add readability NOLINT comments
hikinggrass d69c5da
Reserve space in containers
hikinggrass 9894a38
Use std::array
hikinggrass e3d4b92
Use nullptr instead of NULL
hikinggrass 755223d
Ensure that reset() of object instead of smart ptr is used
hikinggrass 20b7176
Fix unchecked optional access
hikinggrass 48d2b0f
Add some utils tests
hikinggrass b21fbee
Modify drop_transaction_data algorithm to fix some clang-tidy issues
hikinggrass a5ebe13
Ensure operator precedence
hikinggrass 08c5fd0
Use iterator instead of tracking a position manually
hikinggrass 6388e90
Comment out unused parameters
hikinggrass 0a22df2
catch exceptions in destructors
hikinggrass b8e3b07
Remove moves that do not do anything
hikinggrass 0808f2e
Add NOLINT comments for needed reinterpret_casts
hikinggrass ebda6de
clamp values so they do not overflow
hikinggrass d639af2
Use lambdas instead of bind
hikinggrass 3439d7e
Use emplace_back instead of push_back
hikinggrass b48955b
Cast values to appropriate types
hikinggrass 1a1af5b
Remove unused variables and initialization
hikinggrass b748dc8
compare to string::npos
hikinggrass feeefe1
Do not return void from void function
hikinggrass bfab6ea
Remove redundant .get() or .c_str()
hikinggrass 44e22c4
remove duplicate if statement
hikinggrass e33ce88
use container.find()
hikinggrass e1975ae
Ignore widening conversion warnings on very small constant values
hikinggrass c76826d
Fix type of variable
hikinggrass 8c80858
clang-format
hikinggrass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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 |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| Checks: > | ||
| *, | ||
| bugprone-*, | ||
| cert-*, | ||
| concurrency-*, | ||
| cppcoreguidelines-*, | ||
| misc-*, | ||
| performance-*, | ||
| -abseil-*, | ||
| -altera-*, | ||
| -android-*, | ||
| -boost-*, | ||
| -fuchsia-*, | ||
| -google-*, | ||
| -hicpp-*, | ||
| -llvm-*, | ||
| -llvmlibc-*, | ||
| -zircon-*, | ||
| -bugprone-easily-swappable-parameters, | ||
| -cert-err60-cpp, | ||
| -cppcoreguidelines-non-private-member-variables-in-classes, | ||
| -cppcoreguidelines-use-default-member-init, | ||
| -misc-include-cleaner, | ||
| -misc-non-private-member-variables-in-classes, | ||
| -modernize-pass-by-value, | ||
| -modernize-use-trailing-return-type, | ||
| -modernize-use-default-member-init, | ||
| -modernize-return-braced-init-list, | ||
| -modernize-use-scoped-lock, | ||
| -modernize-concat-nested-namespaces, | ||
| -modernize-use-nodiscard, | ||
| -modernize-raw-string-literal, | ||
| -performance-avoid-endl, | ||
| -performance-enum-size, | ||
| -performance-unnecessary-value-param, | ||
| -readability-avoid-const-params-in-decls, | ||
| -readability-function-cognitive-complexity, | ||
| -readability-identifier-length, | ||
| -readability-magic-numbers, | ||
| -readability-qualified-auto, | ||
| -readability-simplify-boolean-expr, | ||
| -readability-use-anyofallof, | ||
| -readability-use-std-min-max, | ||
| -concurrency-mt-unsafe, | ||
| -portability-avoid-pragma-once, | ||
| -portability-template-virtual-member-function, | ||
| -cppcoreguidelines-avoid-const-or-ref-data-members, | ||
| -cppcoreguidelines-avoid-do-while, | ||
| -cppcoreguidelines-avoid-magic-numbers, | ||
| -cppcoreguidelines-macro-usage, | ||
| -cppcoreguidelines-special-member-functions, | ||
| -cppcoreguidelines-pro-type-vararg, | ||
| -cppcoreguidelines-pro-type-member-init, | ||
| -cert-err58-cpp, | ||
| # (the last -cppcoreguidelines and -cert-err58-cpp lines are temporary) | ||
| HeaderFilterRegex: ".*" | ||
| CheckOptions: | ||
| - { key: performance-unnecessary-value-param.AllowedTypes, value: ((std::shared_ptr)) } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ class ClockAlignedTimer : private Everest::Timer<std::chrono::system_clock> { | |
|
|
||
| private: | ||
| system_time_point start_point; | ||
| std::chrono::seconds call_interval; | ||
| std::chrono::seconds call_interval = std::chrono::seconds(0); | ||
|
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. I am guessing the behavior is that the timer doesn't start when the interval is 0, I just want to confirm though |
||
|
|
||
| std::function<void()> callback; | ||
|
|
||
|
|
||
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.
Jumping on something I saw, maybe we should use std::uint16_t?