rubocop.yml in rubocop-shopify-2.14.0 vs rubocop.yml in rubocop-shopify-2.15.0

- old
+ new

@@ -1,12 +1,19 @@ +<% + require "rubocop/shopify/gem_version_string_comparable_backport" + + rubocop_version = Gem.loaded_specs.fetch("rubocop").version +%> + inherit_mode: merge: - Exclude - Include AllCops: StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ + NewCops: disable # New cops will be triaged by style guide maintainers instead. Bundler/OrderedGems: Enabled: false Gemspec/DeprecatedAttributeAssignment: @@ -52,14 +59,14 @@ Layout/HashAlignment: EnforcedLastArgumentHashStyle: ignore_implicit Layout/LineContinuationLeadingSpace: - Enabled: false + Enabled: true Layout/LineContinuationSpacing: - Enabled: false + Enabled: true Layout/LineEndStringConcatenationIndentation: Enabled: true EnforcedStyle: indented @@ -180,13 +187,28 @@ Enabled: false Lint/InterpolationCheck: Enabled: false +<% if rubocop_version >= "1.59" %> +Lint/ItWithoutArgumentsInBlock: + Enabled: true +<% end %> + Lint/LambdaWithoutLiteralBlock: Enabled: false +<% if rubocop_version >= "1.58" %> +Lint/LiteralAssignmentInCondition: + Enabled: true +<% end %> + +<% if rubocop_version >= "1.53" %> +Lint/MixedCaseRange: + Enabled: true +<% end %> + Lint/MixedRegexpCaptureTypes: Enabled: false Lint/MultipleComparison: Enabled: false @@ -216,10 +238,15 @@ Enabled: false Lint/RedundantDirGlobSort: Enabled: false +<% if rubocop_version >= "1.53" %> +Lint/RedundantRegexpQuantifiers: + Enabled: true +<% end %> + Lint/RedundantRequireStatement: Enabled: false Lint/RedundantSafeNavigation: Enabled: false @@ -373,12 +400,11 @@ AllowedRegex: - !ruby/regexp '/master[_\s\.]key/' # Rails master key - !ruby/regexp /\w*:\/\/\S+/ # URLs (e.g. https://github.com/org/repo/blob/master/README.md) - !ruby/regexp '/(?:blob|tree)/master/' # e.g. github.com/org/repo/blob/master/README.md, without https:// - !ruby/regexp '/origin[ \/]master/' # Legacy default git branch name - - 'mastercard' - - 'webmaster' + - !ruby/regexp '/(?<=[a-z])master|master(?=[a-z])/' # "master" substring within a longer word Naming/MemoizedInstanceVariableName: Enabled: false Naming/MethodName: @@ -503,11 +529,11 @@ Style/Encoding: Enabled: false Style/EndlessMethod: - Enabled: false + Enabled: true Style/EnvHome: Enabled: false Style/EvalWithLocation: @@ -540,10 +566,11 @@ Style/FormatStringToken: Enabled: false Style/FrozenStringLiteralComment: SafeAutoCorrect: true + EnforcedStyle: always_true Details: 'Add `# frozen_string_literal: true` to the top of the file. Frozen string literals will become the default in a future Ruby version, and we want to make sure we''re ready.' Style/GuardClause: @@ -575,11 +602,11 @@ Style/IfUnlessModifier: Enabled: false Style/IfWithBooleanLiteralBranches: - Enabled: false + Enabled: true Style/InPatternThen: Enabled: true Style/InverseMethods: @@ -701,10 +728,15 @@ Enabled: false Style/RedundantArgument: Enabled: false +<% if rubocop_version >= "1.52" %> +Style/RedundantArrayConstructor: + Enabled: true +<% end %> + Style/RedundantAssignment: Enabled: false Style/RedundantCondition: Enabled: false @@ -713,10 +745,15 @@ Enabled: false Style/RedundantConstantBase: Enabled: true +<% if rubocop_version >= "1.53" %> +Style/RedundantCurrentDirectoryInPath: + Enabled: true +<% end %> + Style/RedundantDoubleSplatHashBraces: Enabled: true Style/RedundantEach: Enabled: true @@ -725,22 +762,37 @@ Enabled: false Style/RedundantFileExtensionInRequire: Enabled: false +<% if rubocop_version >= "1.52" %> +Style/RedundantFilterChain: + Enabled: true +<% end %> + Style/RedundantHeredocDelimiterQuotes: Enabled: true Style/RedundantInitialize: Enabled: false Style/RedundantLineContinuation: Enabled: true +<% if rubocop_version >= "1.53" %> +Style/RedundantRegexpArgument: + Enabled: true +<% end %> + Style/RedundantRegexpCharacterClass: Enabled: false +<% if rubocop_version >= "1.52" %> +Style/RedundantRegexpConstructor: + Enabled: true +<% end %> + Style/RedundantRegexpEscape: Enabled: false Style/RedundantSelfAssignment: Enabled: false @@ -761,16 +813,26 @@ Enabled: false Style/ReturnNil: Enabled: true +<% if rubocop_version >= "1.53" %> +Style/ReturnNilInPredicateMethodDefinition: + Enabled: true +<% end %> + Style/SelectByRegexp: Enabled: false Style/SingleArgumentDig: Enabled: false +<% if rubocop_version >= "1.57" %> +Style/SingleLineDoEndBlock: + Enabled: true +<% end %> + Style/SlicingWithRange: Enabled: false Style/SoleNestedConditional: Enabled: false @@ -791,10 +853,15 @@ EnforcedStyle: double_quotes Style/StructInheritance: Enabled: false +<% if rubocop_version >= "1.58" %> +Style/SuperWithArgsParentheses: + Enabled: true +<% end %> + Style/SwapValues: Enabled: false Style/SymbolArray: EnforcedStyle: brackets @@ -820,8 +887,13 @@ Style/UnpackFirst: Enabled: false Style/WordArray: EnforcedStyle: brackets + +<% if rubocop_version >= "1.53" %> +Style/YAMLFileRead: + Enabled: true +<% end %> Style/YodaCondition: Enabled: false