Adds a clang-tidy warning for top-level consts in function declarations.
Details
Diff Detail
Event Timeline
Looks good in general. A few nits.
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
23 | "Function names ... should be camel case, and start with a lower case letter (e.g. openFile() or isFoo())." | |
51 | nit: The Diag name is more common for this purpose. | |
52–54 | 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 | ||
5 | To many '='s. | |
9 | Either "do not have any effect on ..." or "do not affect ..." | |
16 | 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 | 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 | "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.)
"Function names ... should be camel case, and start with a lower case letter (e.g. openFile() or isFoo())."
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly