Skip to content

ensure consistent casing of names#10312

Merged
erik-krogh merged 5 commits into
github:mainfrom
erik-krogh:fix-caseDiff
Sep 19, 2022
Merged

ensure consistent casing of names#10312
erik-krogh merged 5 commits into
github:mainfrom
erik-krogh:fix-caseDiff

Conversation

@erik-krogh

@erik-krogh erik-krogh commented Sep 6, 2022

Copy link
Copy Markdown
Contributor

I recently added a QL-for-QL query to detect when two names only differ in casing inside a single language.

E.g. Python used both Multidict and MultiDict.
This can cause confusion, so I'm fixing it.

I did the following renamings:

  • SSA -> Ssa
  • LDAP -> Ldap
  • HTTP -> Http
  • Multidict -> MultiDict
  • URL -> Url
  • Newobj -> NewObj
  • Rethrow -> ReThrow

In Python I had to do a few renamings in order to avoid naming conflicts.

I skipped HTML and API, so those are still used both as HTML/Html and API/Api.

@erik-krogh erik-krogh marked this pull request as ready for review September 9, 2022 10:31
@erik-krogh erik-krogh requested a review from a team September 9, 2022 10:31
@erik-krogh erik-krogh requested review from a team as code owners September 9, 2022 10:31
tausbn
tausbn previously approved these changes Sep 9, 2022

@tausbn tausbn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 👍

michaelnebel
michaelnebel previously approved these changes Sep 9, 2022

@michaelnebel michaelnebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# 👍

geoffw0
geoffw0 previously approved these changes Sep 9, 2022

@geoffw0 geoffw0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ 👍

@RasmusWL RasmusWL left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recently looked at changing the casing to Http in Concepts.qll, but ran into the same problems as you have with the Http modules in Django/Stdlib and so on. I guess renaming them is fine, since they're inside Private... modules that are intended for only internal use.

I was a little surprised about the naming StdHttp, and I think it would more consistent to use StdlibHttp.

Comment thread python/ql/lib/semmle/python/frameworks/Multidict.qll Outdated
Comment thread python/ql/lib/semmle/python/frameworks/Multidict.qll Outdated
Comment thread python/ql/lib/semmle/python/frameworks/Yarl.qll Outdated
Comment thread python/ql/lib/semmle/python/frameworks/Stdlib.qll Outdated
@calumgrant calumgrant requested a review from aibaars September 12, 2022 08:32
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
@erik-krogh erik-krogh dismissed stale reviews from geoffw0, michaelnebel, and tausbn via c9ea10b September 12, 2022 10:00
MathiasVP
MathiasVP previously approved these changes Sep 12, 2022

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 16 potential problems in the proposed changes. Check the Files changed tab for more details.

asgerf
asgerf previously approved these changes Sep 12, 2022

@asgerf asgerf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS 👍

MathiasVP
MathiasVP previously approved these changes Sep 12, 2022
aibaars
aibaars previously approved these changes Sep 12, 2022

@aibaars aibaars left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby changes look good to me.

@erik-krogh erik-krogh requested a review from RasmusWL September 13, 2022 05:54
RasmusWL
RasmusWL previously approved these changes Sep 13, 2022

@RasmusWL RasmusWL left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 👍

@erik-krogh erik-krogh dismissed stale reviews from RasmusWL and aibaars via 03a325c September 13, 2022 08:06

@RasmusWL RasmusWL left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python still 👍 (sorry for the late review, thought this might have been waiting for someone else)

@erik-krogh erik-krogh merged commit a4cd913 into github:main Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants