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

WPS114 Found underscored name pattern failes on cornercase #1243

Closed
AlwxSin opened this issue Mar 6, 2020 · 4 comments · Fixed by #1250
Closed

WPS114 Found underscored name pattern failes on cornercase #1243

AlwxSin opened this issue Mar 6, 2020 · 4 comments · Fixed by #1250
Labels
bug Something isn't working pr-merged

Comments

@AlwxSin
Copy link
Contributor

AlwxSin commented Mar 6, 2020

Bug report

What's wrong

# Correct:
star_wars_episode2 = 'awesome!'

# Incorrect
star_wars_2episode = "also awesome"
test.py
     1:   1 WPS114 Found underscored name pattern: star_wars_2episode [wemake-python-styleguide]
  star_wars_2episode = ""
  ^

How is that should be

Checker should ignore numbers concatenated with strings.

There was a question here but with no answer

@AlwxSin AlwxSin added the bug Something isn't working label Mar 6, 2020
@sobolevn
Copy link
Member

sobolevn commented Mar 6, 2020

Checker should ignore numbers concatenated with strings.

Why do you think so?

The whole idea about this rule was to force sw_episode2 instead of sw_2episode
You can also try sw_2_episode

@AlwxSin
Copy link
Contributor Author

AlwxSin commented Mar 6, 2020

My personal problem is short abbreviations like 1c or 360security. I cant start a variable with a digit but I can't name it like contract_1c firewall_360security

@sobolevn
Copy link
Member

sobolevn commented Mar 6, 2020

Let's make a PR with the experiment to allow this?

AlwxSin added a commit to AlwxSin/wemake-python-styleguide that referenced this issue Mar 9, 2020
@helpr helpr bot added the pr-available label Mar 9, 2020
@AlwxSin
Copy link
Contributor Author

AlwxSin commented Mar 9, 2020

@sobolevn I have made things. Allows characters after digit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pr-merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants