Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace govuk-lint with rubocop-govuk #218

Merged
merged 9 commits into from
Feb 1, 2022
Merged

Replace govuk-lint with rubocop-govuk #218

merged 9 commits into from
Feb 1, 2022

Conversation

brucebolt
Copy link
Member

govuk-lint was deprecated in 2019. We should therefore switch this gem to use the current linter, which is rubocop-govuk.

This makes that switch and fixes the issues identified by rubocop.

@brucebolt brucebolt force-pushed the add-rubocop branch 3 times, most recently from 7d9f9a2 to c48c923 Compare February 1, 2022 10:55
@brucebolt brucebolt marked this pull request as ready for review February 1, 2022 11:21
GOV.UK chanaged linting gem a few years ago. Changing the linting tool
used here too, to ensure this gem remains consistent.
This is a default configuration for a gem used on GOV.UK.
This resolved the majority of the linting failures following the
replacement of govuk-lint with rubocop-govuk.
@brucebolt brucebolt force-pushed the add-rubocop branch 3 times, most recently from d9919c8 to 1cf2b4f Compare February 1, 2022 16:15
This fixes Gemspec/RequiredRubyVersion linting failure.
This fixes the Rake/DuplicateTask linting failure.
This fixes the Style/ClassVars linting failure.
This resolves the Rake/Desc linting failure.
This will require the lint to run as part of the default build.
This keeps the rake tasks in a consistent location and allows us to use
the `load_tasks` helper instead of finding every file.
@brucebolt brucebolt merged commit 5aef5da into master Feb 1, 2022
@brucebolt brucebolt deleted the add-rubocop branch February 1, 2022 16:20
brucebolt added a commit that referenced this pull request Feb 2, 2022
This is specified in the developer documentation [1] but was missed in
the previous PR [2].

1: https://docs.publishing.service.gov.uk/manual/configure-linting.html#linting-ruby
2: #218
ollietreend added a commit that referenced this pull request Feb 2, 2022
A change made in in #218 to the Rakefile resulted in RSpec tests inadvertently being run twice with `bundle exec rake`.

This commit changes the `:default` Rake task so that the RSpec test suite is only run once. It uses the same approach as that used in [contacts-admin](https://github.com/alphagov/contacts-admin/blob/3d190f9541e04a56d7c819da9334820237ea7ac9/Rakefile#L4-L7).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants