Enforce `x`, `x1`,` x2` naming consistency
See original GitHub issueRule request
Thesis
I often see that some people use this naming pattern:
x1 = 1
x2 = 2
Which is perfectly fine. But, this one looks ugly:
x = 1
x2 = 2
Note x1
vs x2
difference.
Reasoning
My proposed solution is to create a new naming rule to check that if a variable named something1
or something2
there should not be just something
in the current scope. While just something
and something1
with something2
are totally fine.
Our own code will have lots of these issues!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Enforce `x`, `x1`,` x2` naming consistency #1381 - Issuehunt
My proposed solution is to create a new naming rule to check that if a variable named something1 or something2 there should not...
Read more >Chapter 3 Consistency-enforcing algorithms: constraint ...
The primary characteristic of consistency in- ference algorithms is the size of the subnetwork involved in the inference.
Read more >Data Scientists, Your Variable Names Are a Mess. Clean Up ...
One of the important points to remember when naming variables is: consistency counts. Staying consistent with variable names means you spend ...
Read more >Local Consistency
Enforcing AC means removing arc-inconsistent values until AC is achieved. Page 22. Arc Consistency. 11 / 43. □ The AC name comes from...
Read more >PEP 8 – Style Guide for Python Code
Consistency with this style guide is important. Consistency within a ... Correct: x = 1 y = 2 long_variable = 3. # Wrong:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Might also want to consider checking for underscores:
Ok, this is hard. There are lots of corner cases and small things to think about.
For example, attributes need special handling:
some.x
andsome.x2
are violating this rulesome.x
andother.x2
are notSo, I am moving this feature for the next version.