Skip to content

Commit

Permalink
Replace govuk-lint with rubocop-govuk and scss_lint-govuk
Browse files Browse the repository at this point in the history
The GOV.UK Lint gem is deprecated in favour of using Rubocop and
scss_lint directly with a set of shared configs.
  • Loading branch information
Christopher Baines committed Nov 26, 2019
1 parent c74fdae commit bfec223
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
inherit_gem:
rubocop-govuk:
- "config/default.yml"

Metrics/BlockLength:
Exclude:
- 'test/**/*_test.rb'
- "test/**/*_test.rb"
1 change: 1 addition & 0 deletions .scss-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugin_gems: ['scss_lint-govuk']
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ gem "slimmer", "~> 13.2"
gem "uglifier", ">= 1.3.0"

group :development, :test do
gem "govuk-lint"
gem "govuk_schemas", "~> 4.0"
gem "jasmine-rails"
gem "rubocop-govuk", "~> 1"
gem "scss_lint-govuk", "~> 0.2"
end

group :development do
Expand Down
16 changes: 9 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ GEM
rest-client (~> 2.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
govuk-lint (4.3.0)
rubocop (~> 0.76)
rubocop-rails (~> 2)
rubocop-rspec (~> 1.28)
scss_lint
govuk_ab_testing (2.4.1)
govuk_app_config (2.0.1)
logstasher (>= 1.2.2, < 1.4.0)
Expand Down Expand Up @@ -264,10 +259,14 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-govuk (1.0.0)
rubocop (~> 0.76)
rubocop-rails (~> 2)
rubocop-rspec (~> 1.28)
rubocop-rails (2.3.2)
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.36.0)
rubocop-rspec (1.37.0)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
rubyzip (2.0.0)
Expand All @@ -293,6 +292,8 @@ GEM
tilt
scss_lint (0.59.0)
sass (~> 3.5, >= 3.5.5)
scss_lint-govuk (0.2.0)
scss_lint
selenium-webdriver (3.142.6)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
Expand Down Expand Up @@ -364,7 +365,6 @@ DEPENDENCIES
dalli
faker
gds-api-adapters (~> 61.0)
govuk-lint
govuk_ab_testing (~> 2.4)
govuk_app_config (~> 2.0)
govuk_frontend_toolkit (~> 8.2.0)
Expand All @@ -382,7 +382,9 @@ DEPENDENCIES
rails-controller-testing (~> 1.0)
rails-i18n (>= 4.0.4)
rails_translation_manager (~> 0.1.0)
rubocop-govuk (~> 1)
sass-rails (~> 5.0)
scss_lint-govuk (~> 0.2)
slimmer (~> 13.2)
uglifier (>= 1.3.0)
webmock (~> 3.7.6)
Expand Down
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@
require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks

unless Rails.env.production?
require "rubocop/rake_task"
require "scss_lint/rake_task"

RuboCop::RakeTask.new(:rubocop) do |t|
t.patterns = %w(app config test Gemfile)
end

SCSSLint::RakeTask.new do |t|
t.files = Dir.glob(["app/assets/stylesheets"])
end

task default: %i[spec rubocop scss_lint]
task lint: %i[rubocop scss_lint]
end
11 changes: 0 additions & 11 deletions lib/tasks/lint.rake

This file was deleted.

0 comments on commit bfec223

Please sign in to comment.