Skip to content

Commit

Permalink
Add workaround for RuboCop 0.35.0 Etc.getlogin bug
Browse files Browse the repository at this point in the history
If a builder executes the `rubocop` command with the latest version the
job fails with a `no implicit conversion of nil into String` error. This
is a known issue with this version and has a fix pending:
rubocop/rubocop#2407
rubocop/rubocop#2408

The easiest delivery-truck workaround is to ensure $USER is set in the
subprocess that executes the linting.
  • Loading branch information
schisamo committed Nov 10, 2015
1 parent 3354231 commit 23d731a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Delivery build_cookbook for your cookbooks!'

version '1.100.7'
version '1.100.8'

source_url 'https://github.com/chef-cookbooks/delivery-truck'
issues_url 'https://github.com/chef-cookbooks/delivery-truck/issues'
Expand Down
4 changes: 4 additions & 0 deletions recipes/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
# Run Rubocop against any cookbooks that were modified.
execute "lint_rubocop_#{cookbook.name}" do
command "rubocop #{cookbook.path}"
environment(
# workaround for https://github.com/bbatsov/rubocop/issues/2407
'USER' => (ENV['USER'] || 'dbuild')
)
only_if { File.exist?(File.join(cookbook.path, '.rubocop.yml')) }
end
end

0 comments on commit 23d731a

Please sign in to comment.