This commit introduces an option to the readability-magic-values checker.
The option defaults to false so that the behavior of the checker doesn't change unless specifically enabled.
These commits are supposed to fix https://github.com/llvm/llvm-project/issues/61259
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is for issue: https://github.com/llvm/llvm-project/issues/61259
Reference it in commit message.
Add config: "flag should be added i.e. IgnoreTypeAliases which will default to false."
Except that looks fine.
Made it so that the proposed change doesn't change the default behavior of the check.
Introduce an option to allow enabling the exclusion.
"Context not available." - use arcanist (just merge all local commits into one), or generate diff with full context (diff -U 9999999).
clang-tools-extra/docs/clang-tidy/checks/readability/magic-numbers.rst | ||
---|---|---|
58 | example put under "Example with magic values refactored:" should be by default as (+-): using containerType = CustomType<int, NUMBER_OF_ELEMENTS>; as this is required by default. |
Generate diff with full context and updated the example to use the default settings of the readabiliy-magic-numbers checker
Thanks for the reviews @PiotrZSL !
Is one review enough or does the second reviewer also need to approve these changes?
If this one is enough, could I ask you (or someone else) to commit the change since I don't have commit access? :)
What should I put as commit author ?
I'm asking because this is diff, and commit author looks to be attached to it.
This should be configurable, someone else may don't want magic numbers in template arguments.
So we shouldn't change default behaviour.