-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
An error occurred while Lint/DeprecatedConstants cop was inspecting #9473
Labels
Comments
Merged
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Jan 30, 2021
Fixes rubocop#9473. This PR fixes the following error for `Lint/DeprecatedConstants` when using `__ENCODING__`. ```console % cat example.rb __ENCODING__ % bundle exec rubocop --only Lint/DeprecatedConstants -d (snip) Inspecting 1 file Scanning /Users/koic/src/github.com/koic/rubocop-issues/9473/example.rb An error occurred while Lint/DeprecatedConstants cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/9473/example.rb. undefined method `expression' for nil:NilClass /Users/koic/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.4.1/lib/rubocop/ast/node.rb:244:in `source' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/lint/deprecated_constants.rb:40:in `on_const' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/commissioner.rb:100:in `public_send' ``` This is a workaround for the error. Maybe further investigation of RuboCop AST will lead to an essential solution.
bbatsov
pushed a commit
that referenced
this issue
Jan 30, 2021
Fixes #9473. This PR fixes the following error for `Lint/DeprecatedConstants` when using `__ENCODING__`. ```console % cat example.rb __ENCODING__ % bundle exec rubocop --only Lint/DeprecatedConstants -d (snip) Inspecting 1 file Scanning /Users/koic/src/github.com/koic/rubocop-issues/9473/example.rb An error occurred while Lint/DeprecatedConstants cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/9473/example.rb. undefined method `expression' for nil:NilClass /Users/koic/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rubocop-ast-1.4.1/lib/rubocop/ast/node.rb:244:in `source' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/lint/deprecated_constants.rb:40:in `on_const' /Users/koic/src/github.com/rubocop-hq/rubocop/lib/rubocop/cop/commissioner.rb:100:in `public_send' ``` This is a workaround for the error. Maybe further investigation of RuboCop AST will lead to an essential solution.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
I've faced with internal RuboCop error, as I see it's related to a new cop (#9324, /cc @koic).
Expected behavior
No errors.
Actual behavior
rubocop
fails.Steps to reproduce the problem
The latest version of RuboCop (1.9.0), Ruby 2.7 or 3.0, this repository: r18n/r18n#247
RuboCop version
The text was updated successfully, but these errors were encountered: