From fcf77c5ce6a54121c42fb8279ce88cad722724b0 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 17 Apr 2013 13:02:50 -0400 Subject: [PATCH 1/2] Run pylint in fewer larger batches --- rakefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/rakefile b/rakefile index d6571118ca..6ed1ecce77 100644 --- a/rakefile +++ b/rakefile @@ -141,16 +141,20 @@ end desc "Run pylint on all #{system} code" task "pylint_#{system}" => report_dir do - Dir["#{system}/*.py", "#{system}/djangoapps/*", "#{system}/lib/*"].each do |app| - pythonpath_prefix = "PYTHONPATH=#{system}:#{system}/djangoapps:#{system}/lib:common/djangoapps:common/lib" - app = File.basename(app) + apps = Dir["#{system}/*.py", "#{system}/djangoapps/*", "#{system}/lib/*"].map do |app| + File.basename(app) + end.select do |app| + app !=~ /.pyc$/ + end.map do |app| if app =~ /.py$/ - app = app.gsub('.py', '') - elsif app =~ /.pyc$/ - next + app.gsub('.py', '') + else + app end - sh("#{pythonpath_prefix} pylint --rcfile=.pylintrc -f parseable #{app} | tee #{report_dir}/#{app}.pylint.report") end + + pythonpath_prefix = "PYTHONPATH=#{system}:#{system}/djangoapps:#{system}/lib:common/djangoapps:common/lib" + sh("#{pythonpath_prefix} pylint --rcfile=.pylintrc -f parseable #{apps.join(' ')} | tee #{report_dir}/pylint.report") end task :pylint => "pylint_#{system}" From c236f0956598d668c7e96ba3cca767915b27e748 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 17 Apr 2013 16:42:27 -0400 Subject: [PATCH 2/2] Install pylint from a specific commit This fixes a bug where some of our linting was crashing due to this pylint bug: http://www.logilab.org/ticket/122793 --- requirements.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 08aaecc71e..6edfbf5fac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -66,7 +66,6 @@ lettuce==0.2.16 mock==0.8.0 nosexcover==1.0.7 pep8==1.4.5 -pylint==0.27.0 rednose==0.3 selenium==2.31.0 splinter==0.5.0 @@ -74,3 +73,7 @@ django_nose==1.1 django-jasmine==0.3.2 django_debug_toolbar django-debug-toolbar-mongo + +# Install pylint from a specific commit on trunk +# to get the fix for this issue: http://www.logilab.org/ticket/122793 +https://bitbucket.org/logilab/pylint/get/e828cb5.zip \ No newline at end of file