Skip to content
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

Allow capital L as variable name #12959

Closed
wants to merge 1 commit into from
Closed

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Mar 17, 2014

Allow capital L as variable name

When the lint uppercase_variables is disallowed/warned about/denied, an
uppercase L (ell) should be still allowed as its lowercase variant is too
similar to an uppercase i or an 1 (one).

When the lint uppercase_variables is disallowed/warned about/denied, an
uppercase L (ell) should be still allowed as its lowercase variant is too
similar to an uppercase i or an 1 (one).
@emberian
Copy link
Member

This doesn't make sense to me. "Disallow uppercase variables, except this random one-character one"

@tbu-
Copy link
Contributor Author

tbu- commented Mar 17, 2014

Well, the point is that you can have all the small latin letters from a-z as single-character variable names, except for the small L, which is why it is used in its capital form in some codebases.

let I = 0;
let l = 0;
let k = I + l + 1;

See for example the above negative-example.

@tbu-
Copy link
Contributor Author

tbu- commented Mar 17, 2014

If this still does not make sense to you, feel free to close this pull request. :)

@emberian
Copy link
Member

I'm more inclined to say "use different variable names" than "add corner case to lint", but I'll leave it to someone else to decide about this PR.

@alexcrichton
Copy link
Member

I think that this is a niche enough use case that already has enough controls over it that it's not that necessary.

Thanks for the PR, though!

@huonw
Copy link
Member

huonw commented Mar 17, 2014

(The work-around of just allowing it would be helped by #12963 which I just opened.)

lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants