Shopify Ruby Style Guide Versions Save

Shopify’s Ruby Style Guide

v2.15.1

2 months ago

What's Changed

Bug fixes

Full Changelog: https://github.com/Shopify/ruby-style-guide/compare/v2.15.0...v2.15.1

v2.15.0

2 months ago

What's Changed

Enabled Cops

Changed Cops

  • Naming/InclusiveLanguage's AllowedRegex is changed to permit any unbroken word which includes master. (#564) The motivation for this change is to avoid continuously needing to add exclusions such as mastercard, remaster, etc. to the list, while still allowing the cop to catch problematic uses of the word master.
  • Style/FrozenStringLiteralComment's EnforcedStyle is changed from always to always_true. (#589) Consumers should aim to use frozen_string_literal: true in all files, but if certain files need frozen_string_literal: false, they should disable the cop in those files, mark them as TODO, or add them to the Exclude list.

Changed AllCops Configuration

  • NewCops is changed from enable to disable. (#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

New Contributors

Full Changelog: https://github.com/Shopify/ruby-style-guide/compare/v2.14.0...v2.15.0

v2.14.0

10 months ago

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 (https://github.com/Shopify/ruby-style-guide/pull/541).

Relevant PRs

New Contributors

Full Changelog: https://github.com/Shopify/ruby-style-guide/compare/v2.13.0...v2.14.0

v2.13.0

1 year ago

What's Changed

Enabled Cops

The following cops have been enabled:

Changed Cops

  • Layout/LineLength now allows inline # rubocop:disable ... comments to exceed the line length. (#488)
  • Layout/LineLength now allows def test_... lines to exceed the line length limit, making it consistent with test "..." do lines, which were already permitted to exceed the limit. (#496)
  • Naming/MethodName now allows methods starting with test_ to violate the snake_case convention. (#511)
  • Style/AndOr now allows and and or 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

New Contributors

Full Changelog: https://github.com/Shopify/ruby-style-guide/compare/v2.12.0...v2.13.0

v2.12.0

1 year ago

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: https://github.com/Shopify/ruby-style-guide/compare/v2.11.1...v2.12.0

v2.11.1

1 year ago

v2.9.0

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/Shopify/ruby-style-guide/compare/v2.8.0...v2.9.0