Foodcritic / foodcritic

Lint tool for Chef cookbooks.
http://foodcritic.io
MIT License
408 stars 153 forks source link

Force UTF8 encoding #745

Closed scotthain closed 6 years ago

scotthain commented 6 years ago

Signed-off-by: Scott Hain shain@chef.io

For example, when you're running in a container you don't control that doesn't have a utf8 locale set.

example:

LC_ALL=C foodcritic .
Checking 48 files
bundler: failed to load command: foodcritic (<snip>/.chefdk/gem/ruby/2.4.0/bin/foodcritic)
ArgumentError: invalid byte sequence in US-ASCII
lamont-granquist commented 6 years ago

prior art: https://github.com/berkshelf/berkshelf/blob/1546390764b5c93a6f1845953032936b350f8878/lib/berkshelf.rb#L29

lamont-granquist commented 6 years ago

you could probably move that into lib/foodcritic.rb if you wanted to use a larger hammer.

scotthain commented 6 years ago

done @lamont-granquist