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

TrailingComma false positive in heredoc #764

Closed
jimmycuadra opened this issue Jan 26, 2014 · 0 comments
Closed

TrailingComma false positive in heredoc #764

jimmycuadra opened this issue Jan 26, 2014 · 0 comments
Assignees

Comments

@jimmycuadra
Copy link

Given the code:

route(/^auth\s+list/, :list, command: true, restrict_to: :admins, help: {
  "auth list [GROUP]" => <<-HELP.chomp
List authorization groups and the users in them. If GROUP is supplied, only lists that group.
HELP
})

Rubocop reports an offense:

C: TrailingComma: Avoid comma after the last item of a hash.
List authorization groups and the users in them. If GROUP is supplied, only lists that group.
                                                                     ^

The comma appears inside a heredoc and should not be treated as following the final key/value pair of the hash.

Rubocop version details:

$ rubocop -V
0.17.0 (using Parser 2.1.4, running on ruby 2.1.0 x86_64-darwin13.0)
@ghost ghost assigned jonas054 Jan 26, 2014
bbatsov added a commit that referenced this issue Jan 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants