From e17c68789ffeacb871c7714e9c8cd888358dc1ed Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Wed, 1 Feb 2017 12:49:10 -0500 Subject: [PATCH] [pylint][regression] support BSD xargs when passing arguments. (#41) * [pylint][regression] support BSD xargs when passing arguments. * [rubocop] be a little more lineant with ABC max complexity. --- .rubocop.yml | 5 +++++ lib/tasks/ci/default.rb | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b0d65c1..c284ca7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -26,3 +26,8 @@ Style/SingleLineBlockParams: BlockLength: Max: 90 + +Metrics/AbcSize: + # The ABC size is a calculated magnitude, so this number can be an Integer or + # a Float. + Max: 18 diff --git a/lib/tasks/ci/default.rb b/lib/tasks/ci/default.rb index 266a696..7222e7f 100644 --- a/lib/tasks/ci/default.rb +++ b/lib/tasks/ci/default.rb @@ -29,9 +29,15 @@ else check_env sh %(flake8 #{ENV['SDK_HOME']}) - sh %(find #{ENV['SDK_HOME']} -name '*.py' -not\ - \\( -path '*.cache*' -or -path '*embedded*' -or -path '*dd-agent*' -or -path '*venv*' -or -path '*.git*' -or -path '*vendor*' \\)\ - | xargs -r -n 80 -P 8 pylint --rcfile=#{ENV['SDK_HOME']}/.pylintrc) + if RUBY_PLATFORM.include? 'darwin' + sh %(find #{ENV['SDK_HOME']} -name '*.py' -not\ + \\( -path '*.cache*' -or -path '*embedded*' -or -path '*dd-agent*' -or -path '*venv*' -or -path '*.git*' -or -path '*vendor*' \\)\ + | xargs -n 80 -P 8 pylint --rcfile=#{ENV['SDK_HOME']}/.pylintrc) + else + sh %(find #{ENV['SDK_HOME']} -name '*.py' -not\ + \\( -path '*.cache*' -or -path '*embedded*' -or -path '*dd-agent*' -or -path '*venv*' -or -path '*.git*' -or -path '*vendor*' \\)\ + | xargs -r -n 80 -P 8 pylint --rcfile=#{ENV['SDK_HOME']}/.pylintrc) + end end end