Last active
May 18, 2016 21:00
-
-
Save jshirley/e1cdfd0e5dd04612d112e4675d038a91 to your computer and use it in GitHub Desktop.
Revisions
-
jshirley revised this gist
May 18, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,4 +7,4 @@ def foo puts "For really real, it isn't" end end end -
jshirley revised this gist
May 18, 2016 . 2 changed files with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Lint/EndAlignment: Exclude: - 'rel/path/broken.rb' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ inherit_from: - .rubocop-todo.yml Documentation: Enabled: false -
jshirley created this gist
May 18, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ source 'https://rubygems.org' gem 'rubocop' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ The rubocop [documentation](https://github.com/bbatsov/rubocop/blame/master/README.md#L425) states "Files and directories are specified relative to the .rubocop.yml file.", however that seems to be untrue based on from where you run rubocop from! Oh no! To demonstrate the breakage, clone this gist and move the broken.rb to a subdirectory: ``` mkdir -p rel/path mv broken.rb rel/path ``` From there, you can confirm that relative paths work from the same directory as .rubocop.yml: ``` bundle bundle exec rubocop rel/path/broken.rb ``` All good! `1 files inspected, no offenses detected` But if I rely on the behavior for rubocop to go upwards to find the `.rubocop.yml` (which it does) it loses the `Excludes` configuration. ``` bundle exec rubocop broken.rb Inspecting 1 file W Offenses: broken.rb:8:7: W: end at 8, 6 is not aligned with if at 4, 4. end ^^^ 1 file inspected, 1 offense detected ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ class Broken def foo # I'm intentionally broken if 1 == 0 puts "This isn't real code." else puts "For really real, it isn't" end end end