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

[FEATURE] Remove blank comments #4238

Closed
andreyfedoseev opened this issue May 5, 2023 · 2 comments
Closed

[FEATURE] Remove blank comments #4238

andreyfedoseev opened this issue May 5, 2023 · 2 comments
Labels
accepted Ready for implementation rule Implementing or modifying a lint rule

Comments

@andreyfedoseev
Copy link

I couldn't find a rule for removing blank comments, so I made one myself.

I can submit a PR if you find that useful, I only need to know what error code to use (I currently use RUF101 locally)

What it does

Check for blank comments.

Why is this bad?

Blank comments are useless and should be removed.

Example

print("Hello, World!")  #

Use instead:

print("Hello, World!")
@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label May 5, 2023
@charliermarsh
Copy link
Member

I agree that this could be useful. I could see a case for either RUF010 (the RUF rules aren't meaningfully categorized by code, so it's fine to just use the next available), or ERA002 (since ERA001 deals with commented-out code). Leaning towards RUF010 though to avoid deviating from an "upstream" plugin.

@charliermarsh
Copy link
Member

This was implemented in the latest release as a pylint rule (#9174).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

3 participants