Adds a clang-tidy warning for top-level consts in function declarations.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looks good in general. A few nits.
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
22 ↗ | (On Diff #51446) | "Function names ... should be camel case, and start with a lower case letter (e.g. openFile() or isFoo())." |
50 ↗ | (On Diff #51446) | nit: The Diag name is more common for this purpose. |
51–53 ↗ | (On Diff #51446) | This is the best wording I could come up with in an internal review, but it's still not ideal. If someone knows how to improve this, ideas are welcome. |
docs/clang-tidy/checks/readability-avoid-const-params-in-decls.rst | ||
4 ↗ | (On Diff #51446) | To many '='s. |
8 ↗ | (On Diff #51446) | Either "do not have any effect on ..." or "do not affect ..." |
15 ↗ | (On Diff #51446) | Please use proper capitalization and punctuation in the comments. |
Looks good with one nit. Thank you for the new check!
Do you need me to submit the patch for you?
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
24 ↗ | (On Diff #51596) | I suspect this will fail to build in MSVC 2013, since it doesn't support uniform initialization. But it might be just initializer lists that it doesn't support. We can try. |
32 ↗ | (On Diff #51596) | "Variable names should be nouns (as they represent state). The name should be camel case, and start with an upper case letter (e.g. Leader or Boats)." |
Actually, we missed one thing: may I ask you to update docs/ReleaseNotes.rst with a short description of the new check?
My attempts to do this end with:
$ arc diff
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
SKIP STAGING Unable to determine repository for this change.
Exception
ERR_CLOSED: This revision has already been closed.
(Run with --trace for a full exception trace.)