-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Empty Comment #4274
Labels
Comments
Yeah, it'd be nice to deal with those. |
@bbatsov glad you feel the same way :) |
I am working on this. |
tejasbubane
added a commit
to tejasbubane/rubocop
that referenced
this issue
Apr 19, 2017
Along with auto-correction. Closes rubocop#4274.
11 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Jan 21, 2018
Fixes rubocop#4274. And reatake rubocop#4288. ## Feature This cop checks empty comment. First of all, this cop only offense a single `#` without a comment text, which is an obvious empty comment. ### Bad case ```ruby # class Foo end ``` ### Good case ```ruby # # Description of `Foo` class. # class Foo end ``` ## Other Information This PR is the first implementation. This implementation always allows: ### Allow leading and trailing blank lines This supported the discussion of the following links. ```ruby # # Does something cool # def something cool puts ":+1:" end ``` rubocop#4288 (comment) [IMO] This format is preferable. ### Allow border comment In this initial implementation, the following border comment is allowed. The reason is that the social impact is unclear. And there are a test codes that depends on border comment. ```ruby def foo end ################# def bar end ``` [IMO] I don't think it is good, so it isn't clearly documented as a good case. In this way the initial implementation is lightweight. It is good to change these so that we can switched by configuration later.
8 tasks
bbatsov
pushed a commit
that referenced
this issue
Jan 21, 2018
Fixes #4274. And reatake #4288. ## Feature This cop checks empty comment. First of all, this cop only offense a single `#` without a comment text, which is an obvious empty comment. ### Bad case ```ruby # class Foo end ``` ### Good case ```ruby # # Description of `Foo` class. # class Foo end ``` ## Other Information This PR is the first implementation. This implementation always allows: ### Allow leading and trailing blank lines This supported the discussion of the following links. ```ruby # # Does something cool # def something cool puts ":+1:" end ``` #4288 (comment) [IMO] This format is preferable. ### Allow border comment In this initial implementation, the following border comment is allowed. The reason is that the social impact is unclear. And there are a test codes that depends on border comment. ```ruby def foo end ################# def bar end ``` [IMO] I don't think it is good, so it isn't clearly documented as a good case. In this way the initial implementation is lightweight. It is good to change these so that we can switched by configuration later.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a feature suggestion for detecting empty comments
Line 2 sticks out like a sore thumb. I know some people who do it just to add an extra line after a class, a way to circumvent one of the rubocop rules:
Style/EmptyLinesAroundBody
. I know the abuse case of this is just to add a dot or something but at least that can be argued as a useless commentThe text was updated successfully, but these errors were encountered: