Skip to main content
Table of contents

Team tools

Migrate from govuk-lint

This is a guide to help you migrate from govuk-lint, which has been deprecated in favour of rubocop-govuk and scss-lint-govuk.

Ruby Projects

Previously, govuk-lint provided a set of RuboCop style rules and a CLI wrapper for RuboCop called govuk-lint-ruby.

We now recommend using RuboCop directly, instead of the CLI wrapper. The style rules previously in govuk-lint have moved to rubocop-govuk and can be imported when using RuboCop.

Changes you may have to make to your project include:

  • Replace the govuk-lint gem with the rubocop-govuk gem in your Gemfile:
# Gemfile
- gem 'govuk-lint'
+ gem 'rubocop-govuk'
  • Add the following lines to your project’s .rubocop.yml config file (you may need to create this):
# .rubocop.yml
inherit_gem:
  rubocop-govuk:
    - config/default.yml
    - config/rails.yml # add this line for Rails projects
  • Replace usage of govuk-lint-ruby with rubocop in your project. All flags and options should be supported, except the --diff flag which should be removed.

SASS Projects

Previously, govuk-lint provided a set of scss-lint style rules and a CLI wrapper for scss-lint called govuk-lint-scss.

We now recommend using scss-lint directly, instead of the CLI wrapper. The style rules previously in govuk-lint have moved to scss-lint-govuk and can be imported when using scss-lint.

Changes you may have to make to your project include:

  • Replace the govuk-lint gem with the scss_lint-govuk gem in your Gemfile:
# Gemfile
- gem 'govuk-lint'
+ gem 'scss_lint-govuk'
  • Add the following lines to your project’s .scss-lint.yml config file (you may need to create this):
# .scss-lint.yml
plugin_gems: ['scss_lint-govuk']
  • Replace usage of govuk-lint-scss with scss-lint in your project.
This page was last reviewed on 2 July 2019. It needs to be reviewed again on 2 January 2020 by the page owner #govuk-developers .
This page was set to be reviewed before 2 January 2020 by the page owner #govuk-developers. This might mean the content is out of date.