Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Enforce use of govuk_link_to et al #1704

Merged
merged 5 commits into from
Jun 3, 2021
Merged

Conversation

paulrobertlloyd
Copy link
Contributor

Context

Add custom cops to check for use of govuk_link_to and govuk_button_to helpers. Also added a cop to check for use of govuk_submit, but disabled until all forms are using the form builder.

This follows a similar PR to that on Apply.

Changes proposed in this pull request

  • Add custom cops
  • Fix instances of helpers not being used
  • Fix a type (missing space in allocations copy)

Guidance to review

Checklist

  • Make sure all information from the Trello card is in here
  • Attach to Trello card
  • Rebased master
  • Cleaned commit history
  • Tested by running locally
  • Product Review

@dankmitchell dankmitchell temporarily deployed to publish-pr-1704 June 3, 2021 08:03 Inactive
@paulrobertlloyd paulrobertlloyd temporarily deployed to publish-pr-1704 June 3, 2021 08:03 Inactive
@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@defong
Copy link
Contributor

defong commented Jun 3, 2021

Should this be a gem thingy now? I think Register also has a clone

@paulrobertlloyd
Copy link
Contributor Author

@defong I wondered if the constituent gems should provide cops somehow – see this issue on the form builder repo. Same thing could possibly be said of the components gem. @peteryates

@peteryates
Copy link
Member

These look great 🙌🏽 Nice work.

I'd be more than happy for a set of cops to be distributed with both the form builder and components gems. There are still a few gotchas that I see (i.e., having to specify link_errors on the first checkbox/radio in a fieldset 🤦🏽) that they'd definitely help with.

@paulrobertlloyd paulrobertlloyd merged commit 5b3a7d3 into master Jun 3, 2021
@paulrobertlloyd paulrobertlloyd deleted the rubocop-for-govuk-helpers branch June 3, 2021 23:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants