alphagov / rubocop-govuk Goto Github PK
View Code? Open in Web Editor NEWRuboCop style rules for GOV.UK's Ruby projects
License: MIT License
RuboCop style rules for GOV.UK's Ruby projects
License: MIT License
Could you create a new release now that the Rubocop version being depended on has been bumped?
Can you provide support rubocop-rails
gem ?
I noticed this on an app's Dependabot gem bump PR CI failure for rubocop-govuk
.
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
- Style/HashEachMethods (0.80)
- Style/HashTransformKeys (0.80)
- Style/HashTransformValues (0.80)
This new informational messaging is a feature which wasn't immediately obvious when dealing with #13 (I was looking for added and removed cops, but not much else).
We should make decisions about whether to include them and bump the gem version again.
With the 4.0.0 changes to rubocop-govuk there are quite a lot of new rules (1, 2) which make us unsure how big the impact will be for GOV.UK. Therefore we are releasing this version as a pre-release to help identify whether it presents any particular challenges for GOV.UK codebases before a wider release.
The approach to adding new rules is to favour consistency with the default rules of the upstream libraries (rubocop, rubcop-rails, etc) over individual opinions on approaches. We've aimed to disable only rules that would produce significant problems in applying to the GOV.UK codebase.
In this pre-release we should ensure that we test
To install this pre-release in app you need to update the Gemfile accordingly:
gem "rubocop-govuk, "4.0.0.pre-1"
This thread can be used to raise any concerns regarding these new rules, particularly where they conflict with GOV.UK conventions or require so many changes adoption will be very difficult.
Initially there have been 2 rules that have proved divisive, where wider opinions are welcomed, these are: Lint/MissingSuper and Lint/UselessMethodDefinition. There are also some concerns that these rules could be difficult to apply are Gemspec/RequiredRubyVersion, Style/CombinableLoops, Style/HashLikeCase. So it'd be good to learn if these are too painful to apply consistently.
Hi team,
Dependabot kindly dropped a PR into one of my teams repos to bump this gem to v3.4.0. One inspected the terminal output I spotted the following warning messages are now being outputted.
/../ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rubocop-govuk-3.4.0/config/other-lint.yml: Lint/EndBlock has the wrong namespace - should be Style
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
- Lint/RaiseException (0.81)
- Lint/StructNewOverride (0.81)
For more information: https://docs.rubocop.org/en/latest/versioning/
Hey geting a lot of errors when running rubocop-govuk on finder-frontend right now.
Should be a simple find and replce job. Will document here then get a PR up to fix.
Warning: Rails/SkipsModelValidations does not support Blacklist parameter.
Supported parameters are:
- Enabled
- ForbiddenMethods
- AllowedMethods
Warning: Rails/SkipsModelValidations does not support Blacklist parameter.
Supported parameters are:
- Enabled
- ForbiddenMethods
- AllowedMethods
Inspecting 279 files
`Blacklist` has been renamed to `ForbiddenMethods`.
.`Blacklist` has been renamed to `ForbiddenMethods`.
.`Blacklist` has been renamed to `ForbiddenMethods`.
.`Blacklist` has been renamed to `ForbiddenMethods`.
.`Blacklist` has been renamed to `ForbiddenMethods`.
[.. others omitted]
In doing #38 we discovered a large number of Cops that have been disabled without any explanation. This could be for a valid reason, but 3cc7240 suggests it's arbitrary.
We should investigate the Cops that have been disabled in this way, and either enable them, or add a comment to explain why they should continue to be disabled.
EnforcedStyle
set without explanation)There's not much point having a styleguide if we're going to ignore it. For new code, it's seldom absolutely necessary to disable a Cop. It's rarely necessary to disable a Cop for an entire repo.
We should try to address this issue by:
Metrics/BlockLength
overridesRepos this issue applies to:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.