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

Add exception to WPS226 to allow commas and dots #2209

Closed
0anton opened this issue Oct 4, 2021 · 3 comments · Fixed by #2210
Closed

Add exception to WPS226 to allow commas and dots #2209

0anton opened this issue Oct 4, 2021 · 3 comments · Fixed by #2210
Assignees
Labels
good first issue Entrypoint to the project Hacktoberfest Hactoberfest fun! help wanted Extra attention is needed level:starter Good for newcomers rule request Adding a new rule
Milestone

Comments

@0anton
Copy link
Contributor

0anton commented Oct 4, 2021

Rule request

I suggest adding comma , and dot . to the list of allowed exceptions for WPS226

Thesis

Forcing defining a constant for dot and comma strings worsen the code readability without need.

Reasoning

It is a classical pattern to build a sentence with the code like:

strings = ['a', 'b', 'c']
','.join(strings)

It feels unnatural to define a constant (e.g. DOT, COMMA) for such obvious case.

Besides that the check WPS226 looks good. I don't like disabling it or increasing the number of string occurrences.
This extends the idea in #1534

@0anton 0anton added the rule request Adding a new rule label Oct 4, 2021
@sobolevn
Copy link
Member

sobolevn commented Oct 4, 2021

@0anton do you want to send a PR with the fix? 🙂

@sobolevn sobolevn added good first issue Entrypoint to the project Hacktoberfest Hactoberfest fun! help wanted Extra attention is needed level:starter Good for newcomers labels Oct 4, 2021
@sobolevn sobolevn added this to the Version 0.16 milestone Oct 4, 2021
@0anton
Copy link
Contributor Author

0anton commented Oct 5, 2021 via email

@0anton
Copy link
Contributor Author

0anton commented Oct 5, 2021

@sobolevn please have a look at my suggestion #2210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Entrypoint to the project Hacktoberfest Hactoberfest fun! help wanted Extra attention is needed level:starter Good for newcomers rule request Adding a new rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants