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

top level public occurs errors #8855

Closed
znz opened this issue Oct 6, 2020 · 0 comments · Fixed by #8856
Closed

top level public occurs errors #8855

znz opened this issue Oct 6, 2020 · 0 comments · Fixed by #8856
Labels

Comments

@znz
Copy link
Contributor

znz commented Oct 6, 2020

Expected behavior

No errors.

Actual behavior

2 errors occurred:
An error occurred while Layout/EmptyLinesAroundAccessModifier cop was inspecting /t.rb:1:0.
An error occurred while Style/AccessModifierDeclarations cop was inspecting /t.rb:1:0.
Errors are usually caused by RuboCop bugs.

Steps to reproduce the problem

% docker run --rm -it ruby:2.7.2 /bin/sh -c 'gem i rubocop; echo public > t.rb; rubocop t.rb'
Fetching parallel-1.19.2.gem
Fetching parser-2.7.1.5.gem
Fetching rainbow-3.0.0.gem
Fetching regexp_parser-1.8.1.gem
Fetching rubocop-0.92.0.gem
Fetching rubocop-ast-0.7.1.gem
Fetching ruby-progressbar-1.10.1.gem
Fetching unicode-display_width-1.7.0.gem
Fetching ast-2.4.1.gem
Successfully installed parallel-1.19.2
Successfully installed ast-2.4.1
Successfully installed parser-2.7.1.5
Successfully installed rainbow-3.0.0
Successfully installed regexp_parser-1.8.1
Successfully installed rubocop-ast-0.7.1
Successfully installed ruby-progressbar-1.10.1
Successfully installed unicode-display_width-1.7.0
Successfully installed rubocop-0.92.0
9 gems installed
Inspecting 1 file
An error occurred while Layout/EmptyLinesAroundAccessModifier cop was inspecting /t.rb:1:0.
To see the complete backtrace run rubocop -d.
An error occurred while Style/AccessModifierDeclarations cop was inspecting /t.rb:1:0.
To see the complete backtrace run rubocop -d.
C

Offenses:

.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
public
^

1 file inspected, 1 offense detected, 1 offense auto-correctable

2 errors occurred:
An error occurred while Layout/EmptyLinesAroundAccessModifier cop was inspecting /t.rb:1:0.
An error occurred while Style/AccessModifierDeclarations cop was inspecting /t.rb:1:0.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop-hq/rubocop/issues

Mention the following information in the issue report:
0.92.0 (using Parser 2.7.1.5, rubocop-ast 0.7.1, running on ruby 2.7.2 x86_64-linux)
koic added a commit to koic/rubocop that referenced this issue Oct 6, 2020
Fixes rubocop#8855.

This PR fixes an error for `Layout/EmptyLinesAroundAccessModifier` and
`Style/AccessModifierDeclarations` when using only access modifier.
@koic koic added the bug label Oct 6, 2020
@koic koic closed this as completed in #8856 Oct 8, 2020
koic added a commit that referenced this issue Oct 8, 2020
[Fix #8855] Fix an error when using only access modifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants