Added extensive documentation to identify the order in which readability-identifier-naming attempts to resolve its classifications. This is followed by an exhaustive code example covering all identifiers commented with their appropriate classifications. This seeks to provide improved information for those seeking to define a particular naming standard.
Phabricator says there is no context available. Did you generate this diff with git diff -U999999 main?
fall, not falling
Below, not Bellow
Does it have to be in the .clang-tidy file, or is it just a matter of setting options?
Why is Struct listed twice?
I would have expected ConstExprVariable instead?
identifies, not identifiers
parameters not paramaters
Clang-tidy, not clang tidy
Should we be linking to ephemeral gists that can disappear?
This covers "const pointer", but what about "pointer to const"?
Same, pointer to const?
Is this really a bug report disguised as a doc comment?
So is this resolution order the same for every Decl?
Are the contents of the file linked and the one in the documentation here the exact same? In that case I think if the author gives rights for LLVM to use their work, we can get rid of the link, as it serves no additional value.
No sorry. Will fix on next submission.
Not as I found it. IdentifierNamingCheck::findStyleKind() is laid out mostly in an ordered fashion, but some checks necessarily repeat either in different context or because of shared semantics. The best example I have is the struct vs class relationship. A struct will first be idenified as SK_Struct, but if there's no naming for that, then it will try SK_Class. Meanwhile, a class does the same thing in the opposite order; first SK_Class then SK_Struct.
I've changed the wording.
This is a reflection of what actually happes. For a struct, it tries to resovle first as a struct, then as a class. Meanwhile, for a class it tries class first then struct. Note the accompanying keywords.
This is also addressed in the paragraph above the list.
That's not the case I'm seeing in code or in the documentation. See https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html#cmdoption-arg-constexprvariablecase
Intentionaly. I'm using the noun, not the verb.
I'm changing this link to a full repo.
Yeah, I'm no expert on all this, but I am the author of both. If I had submitted a patch first then I've wouldn't have included the link.
To answer directly, the contents has only minor differences.
I can add that. Empirically that turned out a ConstantParameter.
I was wrong. There's no const association.
I'm adding a few more variants including static.
Yes it is. Sorry, was captured from my original document. I agree it doesn't belong here.
I've added a new bug report for this: https://github.com/llvm/llvm-project/issues/55705
Clang-Tidy tests and docs have moved to module subdirectories.
Please rebase this onto main:HEAD and:
- fold your changes into the appropriate subdirs, stripping the module prefix from new files.
- make the target check-clang-extra to validate your tests
- make the target docs-clang-tools-html to validate any docs changes