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

Address warning: mismatched indentations at 'when' with 'case' #74

Merged
merged 1 commit into from
Apr 10, 2018

Conversation

yahonda
Copy link
Member

@yahonda yahonda commented Apr 8, 2018

This pull request addresses warning: mismatched indentations at 'when' with 'case'and warning: mismatched indentations at 'else' with 'case' generated by ruby 2.6.0dev (2018-04-07 trunk 63108) [x86_64-linux]

$ bundle exec rake test
/home/yahonda/.rbenv/versions/2.6.0-dev/bin/ruby -w -I"lib:test" -I"/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/rake-12.0.0/lib" "/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb" "test/dom_assertions_test.rb" "test/selector_assertions_test.rb"
... snip ...
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:90: warning: mismatched indentations at 'when' with 'case' at 89
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:92: warning: mismatched indentations at 'when' with 'case' at 89
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:94: warning: mismatched indentations at 'when' with 'case' at 89
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:96: warning: mismatched indentations at 'when' with 'case' at 89
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:99: warning: mismatched indentations at 'when' with 'case' at 89
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:101: warning: mismatched indentations at 'when' with 'case' at 89
/home/yahonda/git/rails-dom-testing/lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb:103: warning: mismatched indentations at 'else' with 'case' at 89
Run options: --seed 23218
... snip ...

How to address these warnings:

These warnings can be easily addressed by using RuboCop. I do not mean to configure it permantently then removed .rubocop.yml and .rubocop_todo.yml at the end of these steps.

  • Execute RuboCop with --auto-gen-config option
$ rubocop --auto-gen-config
  • Edit .rubocop_todo.yml to replace Exclude with Include under Layout/CaseIndentation:
 37 Layout/CaseIndentation:
 38   Include:
 39     - 'lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb'
 40
  • Execute RuboCop --auto-correct option
$ rubocop --auto-correct
  • Remove .rubocop.yml and .rubocop_todo.yml file
$ rm .rubocop.yml .rubocop_todo.yml

and `warning: mismatched indentations at 'else' with 'case'`
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @kaspth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rafaelfranca rafaelfranca merged commit 187cc53 into rails:master Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants