-
Notifications
You must be signed in to change notification settings - Fork 173
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
ci: Add check for mathematical constants (no macros) #3774
Conversation
7d18110
to
926babc
Compare
926babc
to
e8e4b36
Compare
Hi @AJPfleger Is this test simply complaining or is it also trying to replace the code? In the latter case I have some concern since you may have to decide between (e.g.) |
It has a way to fix misused macros. As everything in ACTS, no changes are made without a proper PR. Since we don't have any cases of the macros anymore, they could only be introduced over new PRs. The author could attempt a quick fix using So, I don't really see a worsening of the situation. |
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
The firstly intended clang tidy check `modernize-use-std-numbers` is not suited for us: - it doesn't flag macros like `M_PI` - it flags values in our tables that get close to constants, which have a different basis. benefit would have been to detect cases like `static_cast<float>(std::numbers::pi)` instead of `std::numbers::pi_v<float>` or usages of `std::sqrt(2.)` instead of `std::numbers::sqrt2`. The updated test now checks for the classical `M_*` macros that could be accidentally used. blocked: - acts-project#3781
The firstly intended clang tidy check `modernize-use-std-numbers` is not suited for us: - it doesn't flag macros like `M_PI` - it flags values in our tables that get close to constants, which have a different basis. benefit would have been to detect cases like `static_cast<float>(std::numbers::pi)` instead of `std::numbers::pi_v<float>` or usages of `std::sqrt(2.)` instead of `std::numbers::sqrt2`. The updated test now checks for the classical `M_*` macros that could be accidentally used. blocked: - acts-project#3781
The firstly intended clang tidy check
modernize-use-std-numbers
is not suited for us:M_PI
benefit would have been to detect cases like
static_cast<float>(std::numbers::pi)
instead ofstd::numbers::pi_v<float>
or usages ofstd::sqrt(2.)
instead ofstd::numbers::sqrt2
.The updated test now checks for the classical
M_*
macros that could be accidentally used.blocked:
std::numbers
#3781