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

Idea: Provide a set of custom linters for Rubocop #239

Open
paulrobertlloyd opened this issue Feb 15, 2021 · 1 comment
Open

Idea: Provide a set of custom linters for Rubocop #239

paulrobertlloyd opened this issue Feb 15, 2021 · 1 comment

Comments

@paulrobertlloyd
Copy link
Contributor

On Apply, we’re looking to implement a number of custom linters for Rubocop to check for standard Rails helpers being used instead of GOV.UK specific ones, i.e. here’s one to check that we’re using f.govuk_submit instead of f.submit: DFE-Digital/apply-for-teacher-training@a21ba48

Given this project supersedes a number of rails form helpers, was wondering whether it might be a good idea for it to supply a set of similar cops to lint against forms that don’t use the correct form helpers?

@peteryates
Copy link
Member

This is an interesting idea and definitely worth consideration. There are some things, like link_errors that would really benefit from linting, loads of people forget it.

I have no experience in writing or modifying cops and I suspect it gets quite complicated once you go beyond the basic "don't use that method, use this one" variety. Also disabling overbearing ones within template files is cumbersome - in places where you might want a particular form to have a different non-GOV.UK style one, like for a search box or filter.

I'll have a think about how best to approach it and will keep an eye on the cops I your project which will probably form the basis of anything that 's added. Thanks for the suggestion.

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

No branches or pull requests

2 participants