Releases: Shopify/ruby-style-guide
v2.15.1
What's Changed
Bug fixes
- Add missing files to gemspec & bump version to
2.15.1
by @sambostock in #615
This should fix thecannot load such file -- rubocop/shopify/gem_version_string_comparable_backport
error present inv2.15.0
.
Full Changelog: v2.15.0...v2.15.1
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
'sAllowedRegex
is 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
'sEnforcedStyle
is changed fromalways
toalways_true
. (#589)
Consumers should aim to usefrozen_string_literal: true
in 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 theExclude
list.
Changed AllCops
Configuration
NewCops
is changed fromenable
todisable
. (#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/IfWithBooleanLiteralBranches
by @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: true
by @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.51
by @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
v2.14.0
What's Changed
Enabled Cops
Changed Cops
- Tweak
Naming/InclusiveLanguage
AllowedRegex
to allow more git repository links (#535)
Minimum Rubocop Version
The minimum Rubocop version is now 1.51.0 (#541).
Relevant PRs
- Bump rubocop from 1.50.0 to 1.50.1 by @dependabot in #531
- Enable Style/ReturnNil cop by @larouxn in #529
- Tweak
Naming/InclusiveLanguage
AllowedRegex
by @sambostock in #535 - Bump rubocop from 1.50.2 to 1.51.0 by @dependabot in #541
- Enable the Lint/NoReturnInBeginEndBlocks cop by @catlee in #545
New Contributors
Full Changelog: v2.13.0...v2.14.0
v2.13.0
What's Changed
Enabled Cops
The following cops have been enabled:
Lint/DuplicateMatchPattern
(#525)Metrics/CollectionLiteralLength
(#510)Style/DataInheritance
(#524)Style/DirEmpty
(#510)Style/FileEmpty
(#510)Style/RedundantHeredocDelimiterQuotes
(#497)Style/RedundantLineContinuation
(#524)
Changed Cops
Layout/LineLength
now allows inline# rubocop:disable ...
comments to exceed the line length. (#488)Layout/LineLength
now allowsdef test_...
lines to exceed the line length limit, making it consistent withtest "..." do
lines, which were already permitted to exceed the limit. (#496)Naming/MethodName
now allows methods starting withtest_
to violate thesnake_case
convention. (#511)Style/AndOr
now allowsand
andor
outside of conditionals (which must still use&&
and||
instead). (#515)
Minimum Rubocop Version
The minimum Rubocop version is now 1.50.0
(#525).
Relevant PRs
- Ignore lines made long by cop directive comments by @sambostock in #488
- Allow
def test_...
lines to be long by @sambostock in #496 - Bump rubocop from 1.44.1 to 1.45.1 by @dependabot in #497
- Bump rubocop from 1.45.1 to 1.48.0 by @dependabot in #510
- Allow
test_
method names to violatesnake_case
by @sambostock in #511 - Bump rubocop from 1.48.0 to 1.48.1 by @dependabot in #513
- Set Style/AndOr.EnforcedStyle to 'conditionals' by @cbothner in #515
- Bump rubocop from 1.48.1 to 1.49.0 by @dependabot in #524
- Bump rubocop from 1.49.0 to 1.50.0 by @dependabot in #525
New Contributors
Full Changelog: v2.12.0...v2.13.0
v2.12.0
What's Changed
Enabled Cops
The following cops have been enabled:
Lint/UselessRescue
(#486)Style/ArrayIntersect
(#487)Style/ComparableClamp
(#486)Style/InvertibleUnlessCondition
(#486)Style/OperatorMethodCall
- Originally enabled in #452
- Disabled in #474 due to rubocop/rubocop#11377
- Re-enabled in #475, after rubocop/rubocop#11378 was released
Disabled Cops
The following cops have been disabled:
Gemspec/DevelopmentDependencies
(#486)
Minimum Rubocop Version
The minimum rubocop
version is now 1.44
. (#486)
Full Changelog: v2.11.1...v2.12.0
v2.11.1
v2.11.0
What's Changed
- Require
rubocop
1.42.0 (#467) - Change
Style/NumericLiteralPrefix
'sEnforcedOctalStyle
tozero_with_o
by @sambostock #442 - Enable
Style/MinMaxComparison
by @Korri in #467 - Enable
Lint/DuplicateMagicComment
by @sambostock #452 - Enable
Style/OperatorMethodCall
by @sambostock #452 - Enable
Style/RedundantStringEscape
by @sambostock #452 - Enable
Style/RedundantEach
by @sambostock #457 - Enable
Style/ConcatArrayLiterals
by @sambostock #465 - Enable
Style/RedundantConstantBase
by @sambostock #465 - Enable
Style/RedundantDoubleSplatHashBraces
by @sambostock #465 - Enforce Multiline Method calls, Arrays, and Hashes to use one line per element by @Korri #387
Full Changelog: v2.10.1...v2.11.0
v2.10.1
- Set Style/TrailingCommaInArguments's EnforcedStyleForMultiline to comma by @rafaelfranca #444
Full Changelog: v2.10.0...v2.10.1
2.10.0
What's Changed
- Enable Lint/MissingCopEnableDirective cop by @sambostock in #430
- Enable Lint/RequireRangeParentheses by @rafaelfranca in #431
- Enable Style/MagicCommentFormat by @rafaelfranca in #431
- Enable Style/EmptyHeredoc by @rafaelfranca in #431
- Enable TrailingCommaInArguments by @nunosilva800 in #432
- Enable Style/CaseEquality AllowOnSelfClass option by @sambostock in #441
Full Changelog: v2.9.0...v2.10.0
2.9.0
What's Changed
- Require Rubocop 1.33.0+
- Enable
Style/ClassMethodsDefinitions
with styleself_class
in (#422)
New Contributors
- @dmerand made their first contribution in #420
- @Schwad made their first contribution in #422
- @cursedcoder made their first contribution in #424
Full Changelog: v2.8.0...v2.9.0