You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On files with invalid UTF-8 Encoding (I'm assuming such as binary files although I can't tell which file it is from the error output), the LineEndings check blows up:
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/pre_commit/line_endings.rb:13:in `gsub!'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/pre_commit/line_endings.rb:13:in `block (2 levels) in run'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/pre_commit/line_endings.rb:11:in `each_line'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/pre_commit/line_endings.rb:11:in `block in run'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/pre_commit/line_endings.rb:9:in `map'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/pre_commit/line_endings.rb:9:in `run'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/base.rb:45:in `block in run_and_transform'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/utils.rb:260:in `with_environment'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook/base.rb:45:in `run_and_transform'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook_runner.rb:155:in `run_hook'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook_runner.rb:88:in `block in consume'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook_runner.rb:85:in `loop'
~/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/overcommit-0.39.1/lib/overcommit/hook_runner.rb:85:in `consume'
The text was updated successfully, but these errors were encountered:
jfelchner
changed the title
Invalid UTF-8 Encoding Issue
Invalid UTF-8 Encoding Issue for LineEndings Check
May 8, 2017
Can you dig up what the actual exception thrown was? We could work around this by gracefully catching such exceptions and ignoring those files if they are indeed binary files.
I'm not aware of a good cross-platform way to test whether a file is "binary", so my preference would be to just degrade gracefully in a case where we hit an encoding problem.
UGH. Why didn't I add that for you all? 😧 I believe it was ArgumentError: invalid byte sequence in UTF-8 but I honestly can't even remember the project this happened in. I'm sure when whichever client needs more work done I'll find it again. But I'm pretty sure that was it.
On files with invalid UTF-8 Encoding (I'm assuming such as binary files although I can't tell which file it is from the error output), the
LineEndings
check blows up:The text was updated successfully, but these errors were encountered: