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
When autocorrecting in Style/OneLineConditional you should not receive any errors
Autocorrect fails with:
undefined method `prefix_not?' for s(:self):RuboCop::AST::Node /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/style/one_line_conditional.rb:94:in `keyword_with_changed_precedence?' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/style/one_line_conditional.rb:82:in `requires_parentheses?' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/style/one_line_conditional.rb:74:in `expr_replacement' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/style/one_line_conditional.rb:67:in `to_ternary' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/style/one_line_conditional.rb:60:in `replacement' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/style/one_line_conditional.rb:39:in `block in autocorrect' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/cop.rb:36:in `call' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/corrector.rb:63:in `block (2 levels) in rewrite' /usr/local/lib/ruby/gems/2.6.0/gems/parser-2.7.0.2/lib/parser/source/tree_rewriter.rb:220:in `transaction' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/corrector.rb:62:in `block in rewrite' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/corrector.rb:60:in `each' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/corrector.rb:60:in `rewrite' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/team.rb:136:in `autocorrect_all_cops' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/team.rb:72:in `autocorrect' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/team.rb:108:in `block in offenses' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/team.rb:125:in `investigate' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/team.rb:104:in `offenses' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cop/team.rb:44:in `inspect_file' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:296:in `inspect_file' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:244:in `block in do_inspection_loop' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:276:in `block in iterate_until_no_changes' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:269:in `loop' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:269:in `iterate_until_no_changes' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:240:in `do_inspection_loop' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:119:in `block in file_offenses' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:143:in `file_offense_cache' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:117:in `file_offenses' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:108:in `process_file' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:87:in `block in each_inspected_file' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:86:in `each' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:86:in `reduce' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:86:in `each_inspected_file' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:73:in `inspect_files' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/runner.rb:39:in `run' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli/command.rb:10:in `run' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli/environment.rb:17:in `run' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli.rb:65:in `run_command' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli.rb:72:in `execute_runners' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/lib/rubocop/cli.rb:41:in `run' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/exe/rubocop:13:in `block in <top (required)>' /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/benchmark.rb:308:in `realtime' /usr/local/lib/ruby/gems/2.6.0/gems/rubocop-0.80.0/exe/rubocop:12:in `<top (required)>'
Autocorrect this rather funky code:
res.site (if self.is_a?(Chef::Resource::NoosferoSite) then self else self.site end)
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
rubocop -V
bundle exec rubocop -V
0.80.0
The text was updated successfully, but these errors were encountered:
Style/OneLineConditional
[Fix rubocop#7728] Fix an error for Style/OneLineConditional
8815dda
Fixes rubocop#7728. This PR fixes an error for `Style/OneLineConditional` when one of the branches contains a self keyword.
Merge pull request #7729 from koic/fix_an_error_for_style_one_line_co…
5d47450
…nditional [Fix #7728] Fix an error for `Style/OneLineConditional`
Successfully merging a pull request may close this issue.
Expected behavior
When autocorrecting in Style/OneLineConditional you should not receive any errors
Actual behavior
Autocorrect fails with:
Steps to reproduce the problem
Autocorrect this rather funky code:
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: