From 5ce3a7175974bf88f338cdae518234bc1abae224 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 25 Nov 2019 12:51:48 -0500 Subject: [PATCH] add rubocop as dev dep and configure security and frozen string cops related to #118 --- Gemfile | 15 ++++++++------- Rakefile | 10 ++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index b819a01b..2b1628f0 100644 --- a/Gemfile +++ b/Gemfile @@ -7,16 +7,17 @@ source "https://rubygems.org/" gem "nokogiri", ">=1.5.9" gem "crass", "~>1.0.2" -gem "rake", ">=0.8", :group => [:development, :test] +gem "rake", "~>12.3", :group => [:development, :test] gem "minitest", "~>2.2", :group => [:development, :test] gem "rr", "~>1.2.0", :group => [:development, :test] -gem "json", ">=0", :group => [:development, :test] -gem "hoe-gemspec", ">=0", :group => [:development, :test] -gem "hoe-debugging", ">=0", :group => [:development, :test] -gem "hoe-bundler", ">=0", :group => [:development, :test] -gem "hoe-git", ">=0", :group => [:development, :test] +gem "json", "~>2.2.0", :group => [:development, :test] +gem "hoe-gemspec", "~>1.0", :group => [:development, :test] +gem "hoe-debugging", "~>2.0", :group => [:development, :test] +gem "hoe-bundler", "~>1.5", :group => [:development, :test] +gem "hoe-git", "~>1.6", :group => [:development, :test] gem "concourse", ">=0.26.0", :group => [:development, :test] +gem "rubocop", ">=0.76.0", :group => [:development, :test] gem "rdoc", ">=4.0", "<7", :group => [:development, :test] -gem "hoe", "~>3.17", :group => [:development, :test] +gem "hoe", "~>3.20", :group => [:development, :test] # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index 118e0439..b68407f8 100644 --- a/Rakefile +++ b/Rakefile @@ -28,6 +28,7 @@ Hoe.spec "loofah" do extra_dev_deps << ["hoe-bundler", "~> 1.5"] extra_dev_deps << ["hoe-git", "~> 1.6"] extra_dev_deps << ["concourse", ">=0.26.0"] + extra_dev_deps << ["rubocop", ">=0.76.0"] end task :gemspec do @@ -75,6 +76,15 @@ task :generate_safelists do load "tasks/generate-safelists" end +task :rubocop => [:rubocop_security, :rubocop_frozen_string_literals] +task :rubocop_security do + sh "rubocop lib --only Security" +end +task :rubocop_frozen_string_literals do + sh "rubocop lib --auto-correct --only Style/FrozenStringLiteralComment" +end +Rake::Task[:test].prerequisites << :rubocop + Concourse.new("loofah", fly_target: "ci") do |c| c.add_pipeline "loofah", "loofah.yml" c.add_pipeline "loofah-pr", "loofah-pr.yml"