-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Enforcing consistent casing of acronyms #8323
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
Conversation
name.regexpMatch(".*[A-Z]{4,}.+") and | ||
not node.hasAnnotation("deprecated") and | ||
// allowed upper-case acronyms. | ||
not name.regexpMatch(".*(PEP|AES|DES|EOF).*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also ignore the T
that prefixes some newtype
branches. For instance, TQLDoc
is perfectly valid according to the style guide.
acd31f1
to
a37291e
Compare
|
||
/** | ||
* The query can extend this class to control which functions are printed. | ||
*/ | ||
class PrintASTConfiguration extends TPrintASTConfiguration { | ||
class PrintAstConfiguration extends TPrintASTConfiguration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't TPrintASTConfiguration
also be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I didn't flag the newtype
name itself in the QL-for-QL query, I only flagged the branches.
Fixed with 32b1d98
Just checking: no public interfaces are affected? Hence, no change note required? |
Ehhh. Lots of public interfaces are affected, but the old name is a deprecated alias for the new name. |
If people are going to start seeing deprecated warnings they weren't seeing before, this definitely requires a change note. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C# 👍
@@ -7,67 +7,88 @@ import csharp | |||
/** | |||
* A `Web.config` file. | |||
*/ | |||
class WebConfigXML extends XMLFile { | |||
WebConfigXML() { this.getName().matches("%Web.config") } | |||
class WebConfigXml extends XMLFile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is XMLFile
not also changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess that is because of what you mentioned in the Leftovers
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess that is because of what you mentioned in the Leftovers section.
Exactly. I'll probably look at that in a followup.
I did a rebase on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor Ruby nitpicks, but otherwise LGTM.
I noticed some mistakes here where Java class names occurring in qldoc was accidentally renamed. Fix: #8625 |
Acronyms should be PascalCase/camelCase.
I made a patch for converting the casing of acronyms to PascalCase.
At first I thought it would just be a fun day-of-learning exercise that shouldn't be merged.
However, naming conflicts started showing up (see list below), and now I think this PR should be merged to avoid e.g. having both a
XmlComment
andXMLComment
class in the same scope.Conflicts detected from this:
There are a few places where only the casing on names were different, and those started conflicting with this patch (because they got imported into the same scope).
They are:
isDomRootType(..)
. (one, two). I simply deleted one of them.UrlOpenStreamMethod
. (one, two). One of those were on a.ql
file, so that one just got deleted.XmlComment
classes that did very different things. (one, two). One of them could be renamed toXmlCommentLine
, which I think is a more fitting name.The code in this PR:
Leftovers
There are some leftovers that I haven't renamed yet (classes in
XML.qll
/YAML.qll
).Those are both used in internal tests, and thus require a little more care when merging, so I'm skipping that for now.
I also didn't rename any files.