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

Style/InlineComment #3460

Closed
cppgent0 opened this issue Aug 30, 2016 · 0 comments
Closed

Style/InlineComment #3460

cppgent0 opened this issue Aug 30, 2016 · 0 comments
Labels

Comments

@cppgent0
Copy link

Expected behavior

when Style/InlineComment is enabled true, inline comments are flagged and non-inline comments are not flagged

Actual behavior

lines that are only comments are flagged as inline comments. e.g.
Here is the code:

    ... snip ...
    # TODO: uncomment to test
   ... snip ...
  ts_xx/xx.rb:33:5: C: Style/InlineComment: Avoid inline comments.
       # TODO: uncomment to test
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Steps to reproduce the problem

set InlineComment Enabled to true

Style/InlineComment:
  Description: Avoid inline comments.
  Enabled: true

RuboCop version

$ rubocop -V
0.42.0 (using Parser 2.3.1.2, running on ruby 2.3.1 x86_64-linux)
@bbatsov bbatsov added the bug label Sep 6, 2016
Drenmi added a commit to Drenmi/rubocop that referenced this issue Sep 17, 2016
This cop's check was based on a misunderstanding of how
`Parser::Source::Comment#inline?` works, and was missing a test
case for the negative case.

This change fixes the cop and adds a test for the future.
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…ubocop#3504)

This cop's check was based on a misunderstanding of how
`Parser::Source::Comment#inline?` works, and was missing a test
case for the negative case.

This change fixes the cop and adds a test for the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants