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/AccessorGrouping cop autocorrect mess-up code with comments #8289

Closed
ShockwaveNN opened this issue Jul 9, 2020 · 1 comment · Fixed by #8292
Closed

Style/AccessorGrouping cop autocorrect mess-up code with comments #8289

ShockwaveNN opened this issue Jul 9, 2020 · 1 comment · Fixed by #8292
Labels
bug good first issue Easy task, suitable for newcomers to the project help wanted

Comments

@ShockwaveNN
Copy link
Contributor

Steps to reproduce the problem

  1. Create test.rb file with content:
class Foo
  # [String] Some bar value return
  attr_reader :bar

  # @return [String] value of foo_bar
  attr_reader :foo_bar
end
  1. run rubocop -a with enabled Style/AccessorGrouping cop

Expected behavior

Do not mess up my comments and yard documentation

Actual behavior

Result file is:

class Foo
  # [String] Some bar value return
  attr_reader :bar, :foo_bar

  # @return [String] value of foo_bar
end

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:

$ [bundle exec] rubocop -V
0.87.1 (using Parser 2.7.1.4, rubocop-ast 0.1.0, running on ruby 2.7.1 x86_64-linux)
@marcandre marcandre added bug good first issue Easy task, suitable for newcomers to the project help wanted and removed enhancement labels Jul 9, 2020
@marcandre
Copy link
Contributor

Good catch! We should consider this a bug and not raise an offense in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Easy task, suitable for newcomers to the project help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants