v2.15.0
What's Changed
Enabled Cops
Layout/LineContinuationLeadingSpace(#585)Layout/LineContinuationSpacing(#585)Lint/ItWithoutArgumentsInBlock(#593)Lint/LiteralAssignmentInCondition(#593)Lint/MixedCaseRange(#550)Lint/RedundantRegexpQuantifiers(#550)Style/EndlessMethod(#577)Style/IfWithBooleanLiteralBranches(#551)Style/RedundantArrayConstructor(#544)Style/RedundantCurrentDirectoryInPath(#550)Style/RedundantFilterChain(#544)Style/RedundantRegexpArgument(#550)Style/RedundantRegexpConstructor(#544)Style/ReturnNilInPredicateMethodDefinition(#550)Style/SingleLineDoEndBlock(#582)Style/SuperWithArgsParentheses(#593)Style/YAMLFileRead(#550)
Changed Cops
Naming/InclusiveLanguage'sAllowedRegexis changed to permit any unbroken word which includesmaster. (#564)
The motivation for this change is to avoid continuously needing to add exclusions such asmastercard,remaster, etc. to the list, while still allowing the cop to catch problematic uses of the wordmaster.Style/FrozenStringLiteralComment'sEnforcedStyleis changed fromalwaystoalways_true. (#589)
Consumers should aim to usefrozen_string_literal: truein all files, but if certain files needfrozen_string_literal: false, they should disable the cop in those files, mark them as TODO, or add them to theExcludelist.
Changed AllCops Configuration
NewCopsis changed fromenabletodisable. (#581)
This silences the warning about pending cops for consumers, as the style guide maintainers will triage them instead.
Minimum RuboCop Version
Despite enabling new cops, the minimum RuboCop version is unchanged from the previous release, and remains 1.51.0.
Details
This is possible due to the new approach taken in rubocop.yml, in which ERB is used to conditionally enable cops based on the RuboCop version. (#582, #593, #612)
<% rubocop_version = Gem.loaded_specs.fetch("rubocop").version %>
<% if rubocop_version >= "1.23" %>
Department/NewCopName:
Enabled: true
<% end %>The motivation for this is to try the approach ahead of rubocop-shopify including optional configuration for rubocop-* extensions, which would need to work without adding dependencies on the extensions, or their versions.
Relevant PRs
- Bump rubocop from 1.51.0 to 1.52.0 by @dependabot in #544
- Bump rubocop from 1.52.0 to 1.53.1 by @dependabot in #550
- Enable
Style/IfWithBooleanLiteralBranchesby @nvasilevski in #551 - Allow remaster in Naming/InclusiveLanguage by @kpost in #564
- Enable line continuation cops by @sambostock in #585
- Disable new cops by default by @sambostock in #581
- disallow multi-lines endless methods by @elfassy in #577
- Enforce
frozen_string_literal: trueby @sambostock in #589 - Bump rubocop from 1.56.4 to 1.57.1 by @dependabot in #582
- Bump rubocop from 1.57.1 to 1.59.0 by @dependabot in #593
- Reduce minimum RuboCop version back to
~> 1.51by @sambostock in #612
New Contributors
- @nvasilevski made their first contribution in #551
- @kpost made their first contribution in #564
- @elfassy made their first contribution in #577
Full Changelog: v2.14.0...v2.15.0