We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rubocop works with no errors.
rubocop reports Rails/EnumSyntax crashes:
Rails/EnumSyntax
$ bundle exec rubocop -d (snip) An error occurred while Rails/EnumSyntax cop was inspecting ***. undefined method `key' for nil .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:109:in `option_key?' .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:62:in `block (2 levels) in check_enum_options' .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:61:in `each' .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:61:in `block in check_enum_options' .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:48:in `enum_with_options?' .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:60:in `check_enum_options' .../rubocop-rails-2.26.2/lib/rubocop/cop/rails/enum_syntax.rb:44:in `on_send' (snip)
Inspect following code:
class User < ApplicationRecord enum :card, { clow: 1 }, prefix end
Note: the 3rd argument prefix is a typo for prefix: true.
prefix
prefix: true
1.67.0 (using Parser 3.3.5.0, rubocop-ast 1.32.3, analyzing as Ruby 3.3, running on ruby 3.3.5) [x86_64-linux] - rubocop-capybara 2.21.0 - rubocop-factory_bot 2.26.1 - rubocop-performance 1.22.1 - rubocop-rails 2.26.2 - rubocop-rake 0.6.0 - rubocop-rspec 3.1.0 - rubocop-rspec_rails 2.30.0
The text was updated successfully, but these errors were encountered:
[Fix rubocop#1377] Fix an error for Rails/EnumSyntax
0cb3038
Fixes rubocop#1377 This PR fixes an error for `Rails/EnumSyntax` when positional arguments are used and options are not passed as keyword arguments.
3ca913d
94a8370
Merge pull request #1378 from koic/fix_an_error_for_rails_enum_syntax
f66b8f7
[Fix #1377] Fix an error for `Rails/EnumSyntax`
Successfully merging a pull request may close this issue.
Expected behavior
rubocop works with no errors.
Actual behavior
rubocop reports
Rails/EnumSyntax
crashes:Steps to reproduce the problem
Inspect following code:
Note: the 3rd argument
prefix
is a typo forprefix: true
.RuboCop version
The text was updated successfully, but these errors were encountered: