diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f6d32137..4dab17f6 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: gemfile: [Gemfile, gemfiles/minimum_rubocop.gemfile] - ruby: ["3.0", "3.1", "3.2", "3.3"] + ruby: ["3.1", "3.2", "3.3"] env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/Gemfile.lock b/Gemfile.lock index 55ed782e..153f50e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rubocop-shopify (2.15.1) - rubocop (~> 1.51) + rubocop (~> 1.62) GEM remote: https://rubygems.org/ @@ -12,12 +12,12 @@ GEM byebug (11.1.3) coderay (1.1.3) diffy (3.4.3) - json (2.7.2) - language_server-protocol (3.17.0.3) + json (2.10.1) + language_server-protocol (3.17.0.4) method_source (1.0.0) minitest (5.25.4) - parallel (1.24.0) - parser (3.3.1.0) + parallel (1.26.3) + parser (3.3.7.1) ast (~> 2.4.1) racc pry (0.14.2) @@ -26,26 +26,26 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - racc (1.7.3) + racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.0) - rexml (3.2.6) - rubocop (1.63.4) + regexp_parser (2.10.0) + rubocop (1.71.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) - unicode-display_width (2.5.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) PLATFORMS ruby diff --git a/bin/sort-cops b/bin/sort-cops new file mode 100755 index 00000000..61a78d94 --- /dev/null +++ b/bin/sort-cops @@ -0,0 +1,66 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'yaml' + +def extract_cop_entries(content) + # Extract all cop configurations (entries that start with a department name) + cop_pattern = /^[A-Z][A-Za-z]+\/[A-Za-z]+:/ + cops = {} + + current_cop = nil + current_config = [] + + content.each_line do |line| + if line.match?(cop_pattern) + # Save previous cop if exists + if current_cop + cops[current_cop] = current_config.join + end + + # Start new cop + current_cop = line.split(':').first + current_config = [line] + elsif current_cop + current_config << line + end + end + + # Save last cop + if current_cop + cops[current_cop] = current_config.join + end + + cops +end + +def sort_cops(file_path) + content = File.read(file_path) + + # Extract header (content before first cop) + first_cop_pattern = /^[A-Z][A-Za-z]+\/[A-Za-z]+:/ + header_end = content.index(content.lines.find { |line| line.match?(first_cop_pattern) }) + header = content[0...header_end] + + # Extract and sort cops + cops = extract_cop_entries(content) + sorted_cops = cops.sort_by { |name, _| name } + + # Generate new content + new_content = header + + sorted_cops.each do |_, config| + new_content << config + end + + # Write sorted content back to file + File.write(file_path, new_content) +end + +if ARGV.empty? + puts "Usage: ruby sort_cops.rb path/to/rubocop.yml" + exit 1 +end + +sort_cops(ARGV[0]) +puts "Successfully sorted cops in #{ARGV[0]}" diff --git a/rubocop-cli.yml b/rubocop-cli.yml deleted file mode 100644 index fb7babb9..00000000 --- a/rubocop-cli.yml +++ /dev/null @@ -1,44 +0,0 @@ -inherit_gem: - rubocop-shopify: - - rubocop.yml - -AllCops: - # We don't always use bundler to make for a faster boot time. - # In this case we vendor a small number of dependencies we absolutely - # require. Since they are vendored and 3rd party we do not impose our - # styleguide on them but they are still in the repo. - Exclude: - - 'vendor/**/*' - -# We disable this at entrypoint. -# Due to CLI apps being invoked via an entry point, -# we can exclude this from all files -Style/FrozenStringLiteralComment: - Enabled: false - -# This doesn't take into account retrying from an exception. E.g.: -# begin -# retries ||= 0 -# do_a_thing -# rescue => e -# retry if (retries += 1) < 3 -# handle_error(e) -# end -Lint/SuppressedException: - Enabled: false - -# Allow the use of globals which occasionally makes sense in a CLI app -# As we are not multi-threaded and have a single entry point, this makes it easy to, -# for example, track process environments to restore at the end of invocation -Style/GlobalVars: - Enabled: false - -# Allow readable block formatting in some weird cases -# Particularly in something like: -# Dev::Util.begin do -# might_raise_if_costly_prep_not_done() -# end.retry_after(ExpectedError) do -# costly_prep() -# end -Style/MultilineBlockChain: - Enabled: false diff --git a/rubocop-shopify.gemspec b/rubocop-shopify.gemspec index cb7b1a13..dcd0d18b 100644 --- a/rubocop-shopify.gemspec +++ b/rubocop-shopify.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| "allowed_push_host" => "https://rubygems.org", } - s.required_ruby_version = ">= 3.0.0" + s.required_ruby_version = ">= 3.1.0" - s.add_dependency("rubocop", "~> 1.51") + s.add_dependency("rubocop", "~> 1.62") end diff --git a/rubocop.yml b/rubocop.yml index 09c5d526..9cbf760c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -13,13 +13,24 @@ AllCops: StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ NewCops: disable # New cops will be triaged by style guide maintainers instead. +# Bundler Department Bundler/OrderedGems: Enabled: false + +# Gemspec Department +<% if rubocop_version >= "1.65" %> +Gemspec/AddRuntimeDependency: + Enabled: false +<% end %> + Gemspec/DeprecatedAttributeAssignment: Enabled: true Gemspec/DevelopmentDependencies: + Enabled: true + +Gemspec/OrderedDependencies: Enabled: false Gemspec/RequireMFA: @@ -28,115 +39,373 @@ Gemspec/RequireMFA: Gemspec/RequiredRubyVersion: Enabled: false + +# Layout Department +Layout/AccessModifierIndentation: + Enabled: false + Layout/ArgumentAlignment: + Enabled: false EnforcedStyle: with_fixed_indentation +Layout/ArrayAlignment: + Enabled: false + +Layout/AssignmentIndentation: + Enabled: false + +Layout/BeginEndAlignment: + Enabled: false + +Layout/BlockAlignment: + Enabled: false + +Layout/BlockEndNewline: + Enabled: false + Layout/CaseIndentation: + Enabled: false EnforcedStyle: end +Layout/ClosingHeredocIndentation: + Enabled: false + +Layout/ClosingParenthesisIndentation: + Enabled: false + +Layout/CommentIndentation: + Enabled: false + +Layout/ConditionPosition: + Enabled: false + +Layout/DefEndAlignment: + Enabled: false + +Layout/DotPosition: + Enabled: false + +Layout/ElseAlignment: + Enabled: false + +Layout/EmptyComment: + Enabled: false + +Layout/EmptyLineAfterGuardClause: + Enabled: false + +Layout/EmptyLineAfterMagicComment: + Enabled: false + +Layout/EmptyLineBetweenDefs: + Enabled: false + +Layout/EmptyLines: + Enabled: false + +Layout/EmptyLinesAroundAccessModifier: + Enabled: false + +Layout/EmptyLinesAroundArguments: + Enabled: false + +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false + +Layout/EmptyLinesAroundBeginBody: + Enabled: false + +Layout/EmptyLinesAroundBlockBody: + Enabled: false + +Layout/EmptyLinesAroundClassBody: + Enabled: false + +Layout/EmptyLinesAroundExceptionHandlingKeywords: + Enabled: false + +Layout/EmptyLinesAroundMethodBody: + Enabled: false + +Layout/EmptyLinesAroundModuleBody: + Enabled: false + Layout/EndAlignment: + Enabled: false EnforcedStyleAlignWith: variable +Layout/EndOfLine: + Enabled: false + +Layout/ExtraSpacing: + Enabled: false + Layout/FirstArgumentIndentation: + Enabled: false EnforcedStyle: consistent Layout/FirstArrayElementIndentation: + Enabled: false EnforcedStyle: consistent Layout/FirstArrayElementLineBreak: - Enabled: true AllowMultilineFinalElement: true Layout/FirstHashElementIndentation: + Enabled: false EnforcedStyle: consistent -Layout/FirstHashElementLineBreak: - Enabled: true - Layout/FirstMethodArgumentLineBreak: - Enabled: true AllowMultilineFinalElement: true +Layout/FirstParameterIndentation: + Enabled: false + Layout/HashAlignment: + Enabled: false EnforcedLastArgumentHashStyle: ignore_implicit +Layout/HeredocIndentation: + Enabled: false + +Layout/IndentationConsistency: + Enabled: false + +Layout/IndentationStyle: + Enabled: false + +Layout/IndentationWidth: + Enabled: false + +Layout/InitialIndentation: + Enabled: false + +Layout/LeadingCommentSpace: + Enabled: false + +Layout/LeadingEmptyLines: + Enabled: false + Layout/LineContinuationLeadingSpace: - Enabled: true + Enabled: false Layout/LineContinuationSpacing: - Enabled: true + Enabled: false Layout/LineEndStringConcatenationIndentation: - Enabled: true + Enabled: false EnforcedStyle: indented Layout/LineLength: + Enabled: false AllowedPatterns: - "\\A\\s*(remote_)?test(_\\w+)?\\s.*(do|->)(\\s|\\Z)" - "\\A\\s*def test_\\w+\\s*\\Z" +Layout/MultilineArrayBraceLayout: + Enabled: false + Layout/MultilineArrayLineBreaks: - Enabled: true AllowMultilineFinalElement: true -Layout/MultilineHashKeyLineBreaks: - Enabled: true +Layout/MultilineBlockLayout: + Enabled: false + +Layout/MultilineHashBraceLayout: + Enabled: false Layout/MultilineMethodArgumentLineBreaks: - Enabled: true AllowMultilineFinalElement: true +Layout/MultilineMethodCallBraceLayout: + Enabled: false + Layout/MultilineMethodCallIndentation: - EnforcedStyle: indented - IndentationWidth: 2 + Enabled: false + +Layout/MultilineMethodDefinitionBraceLayout: + Enabled: false Layout/MultilineOperationIndentation: + Enabled: false EnforcedStyle: indented - Layout/ParameterAlignment: + Enabled: false EnforcedStyle: with_fixed_indentation +Layout/RescueEnsureAlignment: + Enabled: false + +Layout/SpaceAfterColon: + Enabled: false + +Layout/SpaceAfterComma: + Enabled: false + +Layout/SpaceAfterMethodName: + Enabled: false + +Layout/SpaceAfterNot: + Enabled: false + +Layout/SpaceAfterSemicolon: + Enabled: false + +Layout/SpaceAroundBlockParameters: + Enabled: false + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: false + +Layout/SpaceAroundKeyword: + Enabled: false + +Layout/SpaceAroundMethodCallOperator: + Enabled: false + +Layout/SpaceAroundOperators: + Enabled: false + +Layout/SpaceBeforeBlockBraces: + Enabled: false + Layout/SpaceBeforeBrackets: - Enabled: true + Enabled: false + +Layout/SpaceBeforeComma: + Enabled: false + +Layout/SpaceBeforeComment: + Enabled: false + +Layout/SpaceBeforeFirstArg: + Enabled: false +Layout/SpaceBeforeSemicolon: + Enabled: false + +Layout/SpaceInLambdaLiteral: + Enabled: false + +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false + +Layout/SpaceInsideArrayPercentLiteral: + Enabled: false + +Layout/SpaceInsideBlockBraces: + Enabled: false + +Layout/SpaceInsideHashLiteralBraces: + Enabled: false + +Layout/SpaceInsideParens: + Enabled: false + +Layout/SpaceInsidePercentLiteralDelimiters: + Enabled: false + +Layout/SpaceInsideRangeLiteral: + Enabled: false + +Layout/SpaceInsideReferenceBrackets: + Enabled: false + +Layout/SpaceInsideStringInterpolation: + Enabled: false + +Layout/TrailingEmptyLines: + Enabled: false + +Layout/TrailingWhitespace: + Enabled: false + + +# Lint Department Lint/AmbiguousAssignment: Enabled: false Lint/AmbiguousBlockAssociation: Enabled: false +Lint/AmbiguousOperator: + Enabled: false + Lint/AmbiguousOperatorPrecedence: Enabled: false Lint/AmbiguousRange: Enabled: false +Lint/AmbiguousRegexpLiteral: + Enabled: false + +<% if rubocop_version >= "1.71" %> +Lint/ArrayLiteralInRegexp: + Enabled: false +<% end %> + +Lint/AssignmentInCondition: + Enabled: false + +Lint/BigDecimalNew: + Enabled: false + +Lint/BinaryOperatorWithIdenticalOperands: + Enabled: false + Lint/BooleanSymbol: Enabled: false +Lint/CircularArgumentReference: + Enabled: false + Lint/ConstantDefinitionInBlock: Enabled: false Lint/ConstantOverwrittenInRescue: - Enabled: true + Enabled: false + +<% if rubocop_version >= "1.70" %> +Lint/ConstantReassignment: + Enabled: false +<% end %> + +Lint/Debugger: + Enabled: false + +Lint/DeprecatedClassMethods: + Enabled: false Lint/DeprecatedConstants: Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false + Lint/DisjunctiveAssignmentInConstructor: Enabled: false Lint/DuplicateBranch: Enabled: false +Lint/DuplicateCaseCondition: + Enabled: false + Lint/DuplicateElsifCondition: Enabled: false +Lint/DuplicateHashKey: + Enabled: false + Lint/DuplicateMagicComment: - Enabled: true + Enabled: false Lint/DuplicateMatchPattern: - Enabled: true + Enabled: false + +Lint/DuplicateMethods: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false @@ -147,6 +416,17 @@ Lint/DuplicateRequire: Lint/DuplicateRescueException: Enabled: false +<% if rubocop_version >= "1.67" %> +Lint/DuplicateSetElement: + Enabled: false +<% end %> + +Lint/EachWithObjectArgument: + Enabled: false + +Lint/ElseLayout: + Enabled: false + Lint/EmptyBlock: Enabled: false @@ -156,6 +436,9 @@ Lint/EmptyClass: Lint/EmptyConditionalBody: Enabled: false +Lint/EmptyEnsure: + Enabled: false + Lint/EmptyExpression: Enabled: false @@ -165,44 +448,82 @@ Lint/EmptyFile: Lint/EmptyInPattern: Enabled: false +Lint/EmptyInterpolation: + Enabled: false + Lint/EmptyWhen: Enabled: false +Lint/EnsureReturn: + Enabled: false + Lint/ErbNewArguments: Enabled: false +Lint/FlipFlop: + Enabled: false + Lint/FloatComparison: Enabled: false +Lint/FloatOutOfRange: + Enabled: false + +Lint/FormatParameterMismatch: + Enabled: false + Lint/HashCompareByIdentity: Enabled: false +<% if rubocop_version >= "1.69" %> +Lint/HashNewWithKeywordArgumentsAsDefault: + Enabled: false +<% end %> + Lint/IdentityComparison: Enabled: false +Lint/ImplicitStringConcatenation: + Enabled: false + Lint/IncompatibleIoSelectWithFiberScheduler: Enabled: false +Lint/IneffectiveAccessModifier: + Enabled: false + +Lint/InheritException: + Enabled: false + Lint/InterpolationCheck: Enabled: false -<% if rubocop_version >= "1.59" %> Lint/ItWithoutArgumentsInBlock: - Enabled: true -<% end %> + Enabled: false Lint/LambdaWithoutLiteralBlock: Enabled: false -<% if rubocop_version >= "1.58" %> +Lint/LiteralAsCondition: + Enabled: false + Lint/LiteralAssignmentInCondition: - Enabled: true -<% end %> + Enabled: false + +Lint/LiteralInInterpolation: + Enabled: false + +Lint/Loop: + Enabled: false + +Lint/MissingCopEnableDirective: + Enabled: false + +Lint/MissingSuper: + Enabled: false -<% if rubocop_version >= "1.53" %> Lint/MixedCaseRange: - Enabled: true -<% end %> + Enabled: false Lint/MixedRegexpCaptureTypes: Enabled: false @@ -210,11 +531,17 @@ Lint/MixedRegexpCaptureTypes: Lint/MultipleComparison: Enabled: false +Lint/NestedMethodDefinition: + Enabled: false + Lint/NestedPercentLiteral: Enabled: false +Lint/NextWithoutAccumulator: + Enabled: false + Lint/NoReturnInBeginEndBlocks: - Enabled: true + Enabled: false Lint/NonAtomicFileOperation: Enabled: false @@ -222,25 +549,52 @@ Lint/NonAtomicFileOperation: Lint/NonDeterministicRequireOrder: Enabled: false +Lint/NonLocalExitFromIterator: + Enabled: false + Lint/NumberedParameterAssignment: Enabled: false +<% if rubocop_version >= "1.69" %> +Lint/NumericOperationWithConstantResult: + Enabled: false +<% end %> + Lint/OrAssignmentToConstant: Enabled: false +Lint/OrderedMagicComments: + Enabled: false + Lint/OutOfRangeRegexpRef: Enabled: false +Lint/ParenthesesAsGroupedExpression: + Enabled: false + +Lint/PercentStringArray: + Enabled: false + +Lint/PercentSymbolArray: + Enabled: false + Lint/RaiseException: Enabled: false +Lint/RandOne: + Enabled: false + +Lint/RedundantCopDisableDirective: + Enabled: false + +Lint/RedundantCopEnableDirective: + Enabled: false + Lint/RedundantDirGlobSort: Enabled: false -<% if rubocop_version >= "1.53" %> Lint/RedundantRegexpQuantifiers: - Enabled: true -<% end %> + Enabled: false Lint/RedundantRequireStatement: Enabled: false @@ -248,6 +602,12 @@ Lint/RedundantRequireStatement: Lint/RedundantSafeNavigation: Enabled: false +Lint/RedundantSplatExpansion: + Enabled: false + +Lint/RedundantStringCoercion: + Enabled: false + Lint/RedundantWithIndex: Enabled: false @@ -260,11 +620,17 @@ Lint/RefinementImportMethods: Lint/RegexpAsCondition: Enabled: false +Lint/RequireParentheses: + Enabled: false + Lint/RequireRangeParentheses: - Enabled: true + Enabled: false Lint/RequireRelativeSelfPath: - Enabled: true + Enabled: false + +Lint/RescueException: + Enabled: false Lint/RescueType: Enabled: false @@ -272,6 +638,9 @@ Lint/RescueType: Lint/ReturnInVoidContext: Enabled: false +Lint/SafeNavigationChain: + Enabled: false + Lint/SafeNavigationConsistency: Enabled: false @@ -290,12 +659,23 @@ Lint/SendWithMixinArgument: Lint/ShadowedArgument: Enabled: false +Lint/ShadowedException: + Enabled: false + Lint/ShadowingOuterLocalVariable: Enabled: false +<% if rubocop_version >= "1.70" %> +Lint/SharedMutableDefault: + Enabled: false +<% end %> + Lint/StructNewOverride: Enabled: false +Lint/SuppressedException: + Enabled: false + Lint/SymbolConversion: Enabled: false @@ -314,15 +694,32 @@ Lint/TrailingCommaInAttributeDeclaration: Lint/TripleQuotes: Enabled: false +Lint/UnderscorePrefixedVariableName: + Enabled: false + +<% if rubocop_version >= "1.68" %> +Lint/UnescapedBracketInRegexp: + Enabled: false +<% end %> + Lint/UnexpectedBlockArity: Enabled: false +Lint/UnifiedInteger: + Enabled: false + Lint/UnmodifiedReduceAccumulator: Enabled: false +Lint/UnreachableCode: + Enabled: false + Lint/UnreachableLoop: Enabled: false +Lint/UnusedBlockArgument: + Enabled: false + Lint/UnusedMethodArgument: Enabled: false @@ -332,29 +729,59 @@ Lint/UriEscapeUnescape: Lint/UriRegexp: Enabled: false +Lint/UselessAccessModifier: + Enabled: false + +Lint/UselessAssignment: + Enabled: false + +<% if rubocop_version >= "1.69" %> +Lint/UselessDefined: + Enabled: false +<% end %> + +Lint/UselessElseWithoutRescue: + Enabled: false + Lint/UselessMethodDefinition: Enabled: false +<% if rubocop_version >= "1.66" %> +Lint/UselessNumericOperation: + Enabled: false +<% end %> + Lint/UselessRescue: - Enabled: true + Enabled: false Lint/UselessRuby2Keywords: - Enabled: true + Enabled: false + +Lint/UselessSetterCall: + Enabled: false Lint/UselessTimes: Enabled: false +Lint/Void: + Enabled: false + + +# Metrics Department Metrics/AbcSize: Enabled: false Metrics/BlockLength: Enabled: false +Metrics/BlockNesting: + Enabled: false + Metrics/ClassLength: Enabled: false Metrics/CollectionLiteralLength: - Enabled: true + Enabled: false Metrics/CyclomaticComplexity: Enabled: false @@ -366,20 +793,43 @@ Metrics/ModuleLength: Enabled: false Metrics/ParameterLists: + Enabled: false CountKeywordArgs: false Metrics/PerceivedComplexity: Enabled: false + +# Migration Department Migration/DepartmentName: Enabled: false + +# Naming Department +Naming/AccessorMethodName: + Enabled: false + +Naming/AsciiIdentifiers: + Enabled: false + +Naming/BinaryOperatorParameterName: + Enabled: false + Naming/BlockForwarding: Enabled: false Naming/BlockParameterName: Enabled: false +Naming/ClassAndModuleCamelCase: + Enabled: false + +Naming/ConstantName: + Enabled: false + +Naming/FileName: + Enabled: false + Naming/HeredocDelimiterCase: Enabled: false @@ -390,6 +840,7 @@ Naming/MemoizedInstanceVariableName: Enabled: false Naming/MethodName: + Enabled: false AllowedPatterns: - '\Atest_' @@ -397,6 +848,7 @@ Naming/MethodParameterName: Enabled: false Naming/PredicateName: + Enabled: false NamePrefix: - is_ ForbiddenPrefixes: @@ -405,21 +857,37 @@ Naming/PredicateName: Naming/RescuedExceptionsVariableName: Enabled: false +Naming/VariableName: + Enabled: false + Naming/VariableNumber: Enabled: false + +# Security Department Security/CompoundHash: Enabled: false +Security/Eval: + Enabled: false + Security/IoMethods: - Enabled: true + Enabled: false + +Security/JSONLoad: + Enabled: false Security/MarshalLoad: Enabled: false +Security/Open: + Enabled: false + Security/YAMLLoad: Enabled: false + +# Style Department Style/AccessModifierDeclarations: Enabled: false @@ -427,63 +895,130 @@ Style/AccessorGrouping: Enabled: false Style/Alias: + Enabled: false EnforcedStyle: prefer_alias_method +<% if rubocop_version >= "1.68" %> +Style/AmbiguousEndlessMethodDefinition: + Enabled: false +<% end %> + +Style/AndOr: + Enabled: false + Style/ArgumentsForwarding: Enabled: false Style/ArrayIntersect: - Enabled: true + Enabled: false + +Style/ArrayJoin: + Enabled: false + +Style/Attr: + Enabled: false + +Style/BarePercentLiterals: + Enabled: false + +Style/BeginBlock: + Enabled: false Style/BisectedAttrAccessor: Enabled: false +<% if rubocop_version >= "1.68" %> +Style/BitwisePredicate: + Enabled: false +<% end %> + +Style/BlockComments: + Enabled: false + +Style/BlockDelimiters: + Enabled: false + Style/CaseEquality: + Enabled: false AllowOnConstant: true AllowOnSelfClass: true Style/CaseLikeIf: Enabled: false +Style/CharacterLiteral: + Enabled: false + +Style/ClassAndModuleChildren: + Enabled: false + +Style/ClassCheck: + Enabled: false + Style/ClassEqualityComparison: Enabled: false +Style/ClassMethods: + Enabled: false + Style/ClassMethodsDefinitions: EnforcedStyle: self_class - Enabled: true + +Style/ClassVars: + Enabled: false Style/CollectionCompact: Enabled: false +Style/ColonMethodCall: + Enabled: false + Style/ColonMethodDefinition: Enabled: false +<% if rubocop_version >= "1.68" %> +Style/CombinableDefined: + Enabled: false +<% end %> + Style/CombinableLoops: Enabled: false Style/CommandLiteral: + Enabled: false EnforcedStyle: percent_x +Style/CommentAnnotation: + Enabled: false + Style/CommentedKeyword: Enabled: false Style/ComparableClamp: - Enabled: true + Enabled: false Style/ConcatArrayLiterals: - Enabled: true + Enabled: false + +Style/ConditionalAssignment: + Enabled: false Style/DataInheritance: - Enabled: true + Enabled: false -Style/DateTime: - Enabled: true +Style/DefWithParentheses: + Enabled: false + +<% if rubocop_version >= "1.69" %> +Style/DigChain: + Enabled: false +<% end %> Style/Dir: Enabled: false Style/DirEmpty: - Enabled: true + Enabled: false Style/DocumentDynamicEvalDefinition: Enabled: false @@ -497,26 +1032,42 @@ Style/DoubleCopDisableDirective: Style/DoubleNegation: Enabled: false +Style/EachForSimpleLoop: + Enabled: false + +Style/EachWithObject: + Enabled: false + Style/EmptyBlockParameter: Enabled: false +Style/EmptyCaseCondition: + Enabled: false + Style/EmptyElse: + Enabled: false AllowComments: true Style/EmptyHeredoc: - Enabled: true + Enabled: false Style/EmptyLambdaParameter: Enabled: false +Style/EmptyLiteral: + Enabled: false + Style/EmptyMethod: Enabled: false Style/Encoding: Enabled: false +Style/EndBlock: + Enabled: false + Style/EndlessMethod: - Enabled: true + Enabled: false Style/EnvHome: Enabled: false @@ -524,12 +1075,18 @@ Style/EnvHome: Style/EvalWithLocation: Enabled: false +Style/EvenOdd: + Enabled: false + Style/ExactRegexpMatch: - Enabled: true + Enabled: false Style/ExpandPathArguments: Enabled: false +Style/ExplicitBlockArgument: + Enabled: false + Style/ExponentialNotation: Enabled: false @@ -537,17 +1094,33 @@ Style/FetchEnvVar: Enabled: false Style/FileEmpty: - Enabled: true + Enabled: false + +<% if rubocop_version >= "1.69" %> +Style/FileNull: + Enabled: false +<% end %> Style/FileRead: Enabled: false +<% if rubocop_version >= "1.69" %> +Style/FileTouch: + Enabled: false +<% end %> + Style/FileWrite: Enabled: false Style/FloatDivision: Enabled: false +Style/For: + Enabled: false + +Style/FormatString: + Enabled: false + Style/FormatStringToken: Enabled: false @@ -558,6 +1131,12 @@ Style/FrozenStringLiteralComment: literals will become the default in a future Ruby version, and we want to make sure we''re ready.' +Style/GlobalStdStream: + Enabled: false + +Style/GlobalVars: + Enabled: false + Style/GuardClause: Enabled: false @@ -576,8 +1155,16 @@ Style/HashExcept: Style/HashLikeCase: Enabled: false +<% if rubocop_version >= "1.71" %> +Style/HashSlice: + Enabled: false +<% end %> + Style/HashSyntax: + Enabled: false +<% if rubocop_version < "1.67" %> EnforcedShorthandSyntax: either +<% end %> Style/HashTransformKeys: Enabled: false @@ -585,20 +1172,42 @@ Style/HashTransformKeys: Style/HashTransformValues: Enabled: false +Style/IdenticalConditionalBranches: + Enabled: false + +Style/IfInsideElse: + Enabled: false + Style/IfUnlessModifier: Enabled: false +Style/IfUnlessModifierOfIfUnless: + Enabled: false + Style/IfWithBooleanLiteralBranches: - Enabled: true + Enabled: false + +Style/IfWithSemicolon: + Enabled: false Style/InPatternThen: - Enabled: true + Enabled: false + +Style/InfiniteLoop: + Enabled: false Style/InverseMethods: Enabled: false -Style/InvertibleUnlessCondition: - Enabled: true +<% if rubocop_version >= "1.70" %> +Style/ItAssignment: + Enabled: false +<% end %> + +<% if rubocop_version >= "1.68" %> +Style/KeywordArgumentsMerging: + Enabled: false +<% end %> Style/KeywordParametersOrder: Enabled: false @@ -606,8 +1215,14 @@ Style/KeywordParametersOrder: Style/Lambda: Enabled: false +Style/LambdaCall: + Enabled: false + +Style/LineEndConcatenation: + Enabled: false + Style/MagicCommentFormat: - Enabled: true + Enabled: false ValueCapitalization: lowercase Style/MapCompactWithConditionalBlock: @@ -625,7 +1240,6 @@ Style/MapToSet: Enabled: false Style/MethodCallWithArgsParentheses: - Enabled: true AllowedMethods: - require - require_relative @@ -636,16 +1250,29 @@ Style/MethodCallWithArgsParentheses: Exclude: - "/**/Gemfile" +Style/MethodCallWithoutArgsParentheses: + Enabled: false + +Style/MethodDefParentheses: + Enabled: false + Style/MinMax: Enabled: false Style/MinMaxComparison: - Enabled: true + Enabled: false + +Style/MissingRespondToMissing: + Enabled: false Style/MixinGrouping: Enabled: false +Style/MixinUsage: + Enabled: false + Style/ModuleFunction: + Enabled: false EnforcedStyle: extend_self Style/MultilineBlockChain: @@ -654,9 +1281,18 @@ Style/MultilineBlockChain: Style/MultilineIfModifier: Enabled: false +Style/MultilineIfThen: + Enabled: false + Style/MultilineInPatternThen: Enabled: false +Style/MultilineMemoization: + Enabled: false + +Style/MultilineTernaryOperator: + Enabled: false + Style/MultilineWhenThen: Enabled: false @@ -666,24 +1302,54 @@ Style/MultipleComparison: Style/MutableConstant: Enabled: false +Style/NegatedIf: + Enabled: false + Style/NegatedIfElseCondition: Enabled: false Style/NegatedUnless: Enabled: false +Style/NegatedWhile: + Enabled: false + Style/NestedFileDirname: - Enabled: true + Enabled: false + +Style/NestedModifier: + Enabled: false + +Style/NestedParenthesizedCalls: + Enabled: false + +Style/NestedTernaryOperator: + Enabled: false + +Style/Next: + Enabled: false + +Style/NilComparison: + Enabled: false Style/NilLambda: Enabled: false +Style/NonNilCheck: + Enabled: false + +Style/Not: + Enabled: false + Style/NumberedParameters: Enabled: false Style/NumberedParametersLimit: Enabled: false +Style/NumericLiteralPrefix: + Enabled: false + Style/NumericLiterals: Enabled: false @@ -693,11 +1359,17 @@ Style/NumericPredicate: Style/ObjectThen: Enabled: false +Style/OneLineConditional: + Enabled: false + Style/OpenStructUse: - Enabled: true + Enabled: false Style/OperatorMethodCall: - Enabled: true + Enabled: false + +Style/OptionalArguments: + Enabled: false Style/OptionalBooleanParameter: Enabled: false @@ -705,26 +1377,50 @@ Style/OptionalBooleanParameter: Style/OrAssignment: Enabled: false +Style/ParallelAssignment: + Enabled: false + +Style/ParenthesesAroundCondition: + Enabled: false + Style/PercentLiteralDelimiters: Enabled: false +Style/PercentQLiterals: + Enabled: false + +Style/PerlBackrefs: + Enabled: false + +Style/PreferredHashMethods: + Enabled: false + +Style/Proc: + Enabled: false + Style/QuotedSymbols: - Enabled: true + Enabled: false +Style/RaiseArgs: + Enabled: false Style/RandomWithOffset: Enabled: false Style/RedundantArgument: Enabled: false -<% if rubocop_version >= "1.52" %> Style/RedundantArrayConstructor: - Enabled: true -<% end %> + Enabled: false Style/RedundantAssignment: Enabled: false +Style/RedundantBegin: + Enabled: false + +Style/RedundantCapitalW: + Enabled: false + Style/RedundantCondition: Enabled: false @@ -732,18 +1428,19 @@ Style/RedundantConditional: Enabled: false Style/RedundantConstantBase: - Enabled: true + Enabled: false -<% if rubocop_version >= "1.53" %> Style/RedundantCurrentDirectoryInPath: - Enabled: true -<% end %> + Enabled: false Style/RedundantDoubleSplatHashBraces: - Enabled: true + Enabled: false Style/RedundantEach: - Enabled: true + Enabled: false + +Style/RedundantException: + Enabled: false Style/RedundantFetchBlock: Enabled: false @@ -751,36 +1448,53 @@ Style/RedundantFetchBlock: Style/RedundantFileExtensionInRequire: Enabled: false -<% if rubocop_version >= "1.52" %> Style/RedundantFilterChain: - Enabled: true -<% end %> + Enabled: false + +Style/RedundantFreeze: + Enabled: false Style/RedundantHeredocDelimiterQuotes: - Enabled: true + Enabled: false Style/RedundantInitialize: Enabled: false +Style/RedundantInterpolation: + Enabled: false + +<% if rubocop_version >= "1.66" %> +Style/RedundantInterpolationUnfreeze: + Enabled: false +<% end %> + Style/RedundantLineContinuation: - Enabled: true + Enabled: false + +Style/RedundantParentheses: + Enabled: false + +Style/RedundantPercentQ: + Enabled: false -<% if rubocop_version >= "1.53" %> Style/RedundantRegexpArgument: - Enabled: true -<% end %> + Enabled: false Style/RedundantRegexpCharacterClass: Enabled: false -<% if rubocop_version >= "1.52" %> Style/RedundantRegexpConstructor: - Enabled: true -<% end %> + Enabled: false Style/RedundantRegexpEscape: Enabled: false +Style/RedundantReturn: + Enabled: false + +Style/RedundantSelf: + Enabled: false + Style/RedundantSelfAssignment: Enabled: false @@ -790,33 +1504,61 @@ Style/RedundantSelfAssignmentBranch: Style/RedundantSort: Enabled: false +Style/RedundantSortBy: + Enabled: false + Style/RedundantStringEscape: - Enabled: true + Enabled: false Style/RegexpLiteral: + Enabled: false EnforcedStyle: mixed -Style/RescueStandardError: +Style/RescueModifier: Enabled: false -Style/ReturnNil: - Enabled: true +Style/RescueStandardError: + Enabled: false -<% if rubocop_version >= "1.53" %> Style/ReturnNilInPredicateMethodDefinition: - Enabled: true + Enabled: false + +Style/SafeNavigation: + Enabled: false + +<% if rubocop_version >= "1.68" %> +Style/SafeNavigationChainLength: + Enabled: false <% end %> +Style/Sample: + Enabled: false + Style/SelectByRegexp: Enabled: false +Style/SelfAssignment: + Enabled: false + +Style/Semicolon: + Enabled: false + +<% if rubocop_version >= "1.64" %> +Style/SendWithLiteralMethodName: + Enabled: false +<% end %> + +Style/SignalException: + Enabled: false + Style/SingleArgumentDig: Enabled: false -<% if rubocop_version >= "1.57" %> Style/SingleLineDoEndBlock: - Enabled: true -<% end %> + Enabled: false + +Style/SingleLineMethods: + Enabled: false Style/SlicingWithRange: Enabled: false @@ -824,6 +1566,12 @@ Style/SlicingWithRange: Style/SoleNestedConditional: Enabled: false +Style/SpecialGlobalVars: + Enabled: false + +Style/StabbyLambdaParentheses: + Enabled: false + Style/StderrPuts: Enabled: false @@ -834,35 +1582,62 @@ Style/StringConcatenation: Enabled: false Style/StringLiterals: + Enabled: false EnforcedStyle: double_quotes Style/StringLiteralsInInterpolation: + Enabled: false EnforcedStyle: double_quotes +Style/Strip: + Enabled: false + Style/StructInheritance: Enabled: false -<% if rubocop_version >= "1.58" %> -Style/SuperWithArgsParentheses: - Enabled: true +<% if rubocop_version >= "1.64" %> +Style/SuperArguments: + Enabled: false <% end %> +Style/SuperWithArgsParentheses: + Enabled: false + Style/SwapValues: Enabled: false Style/SymbolArray: + Enabled: false EnforcedStyle: brackets +Style/SymbolLiteral: + Enabled: false + +Style/SymbolProc: + Enabled: false + +Style/TernaryParentheses: + Enabled: false + +Style/TrailingBodyOnClass: + Enabled: false + Style/TrailingBodyOnMethodDefinition: Enabled: false +Style/TrailingBodyOnModule: + Enabled: false + Style/TrailingCommaInArguments: + Enabled: false EnforcedStyleForMultiline: comma Style/TrailingCommaInArrayLiteral: + Enabled: false EnforcedStyleForMultiline: consistent_comma Style/TrailingCommaInHashLiteral: + Enabled: false EnforcedStyleForMultiline: consistent_comma Style/TrailingMethodEndStatement: @@ -871,16 +1646,36 @@ Style/TrailingMethodEndStatement: Style/TrailingUnderscoreVariable: Enabled: false +Style/TrivialAccessors: + Enabled: false + +Style/UnlessElse: + Enabled: false + Style/UnpackFirst: Enabled: false +Style/VariableInterpolation: + Enabled: false + +Style/WhenThen: + Enabled: false + +Style/WhileUntilDo: + Enabled: false + +Style/WhileUntilModifier: + Enabled: false + Style/WordArray: + Enabled: false EnforcedStyle: brackets -<% if rubocop_version >= "1.53" %> Style/YAMLFileRead: - Enabled: true -<% end %> + Enabled: false Style/YodaCondition: Enabled: false + +Style/ZeroLengthPredicate: + Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index a4ec0cf6..6b068660 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -70,6 +70,7 @@ AllCops: DisplayStyleGuide: false StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ DocumentationBaseURL: https://docs.rubocop.org/rubocop + DocumentationExtension: ".html" ExtraDetails: false StyleGuideCopsOnly: false EnabledByDefault: false @@ -86,6 +87,7 @@ AllCops: - rails rubocop-rspec: - rspec + - rspec-rails rubocop-minitest: - minitest rubocop-sequel: @@ -102,6 +104,7 @@ AllCops: rubocop-rspec_rails: - rspec-rails ActiveSupportExtensionsEnabled: false + StringLiteralsFrozenByDefault: Bundler/DuplicatedGem: Description: Checks for duplicate gem entries in Gemfile. Enabled: true @@ -182,6 +185,14 @@ Bundler/OrderedGems: - "**/*.gemfile" - "**/Gemfile" - "**/gems.rb" +Gemspec/AddRuntimeDependency: + Description: Prefer `add_dependency` over `add_runtime_dependency`. + StyleGuide: "#add_dependency_vs_add_runtime_dependency" + Reference: https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316 + Enabled: false + VersionAdded: '1.65' + Include: + - "**/*.gemspec" Gemspec/DependencyVersion: Description: Requires or forbids specifying gem dependency versions. Enabled: false @@ -205,7 +216,7 @@ Gemspec/DeprecatedAttributeAssignment: Gemspec/DevelopmentDependencies: Description: Checks that development dependencies are specified in Gemfile rather than gemspec. - Enabled: false + Enabled: true VersionAdded: '1.44' EnforcedStyle: Gemfile SupportedStyles: @@ -228,7 +239,7 @@ Gemspec/DuplicatedAssignment: - "**/*.gemspec" Gemspec/OrderedDependencies: Description: Dependencies in the gemspec should be alphabetically sorted. - Enabled: true + Enabled: false VersionAdded: '0.51' TreatCommentsAsGroupSeparators: true ConsiderPunctuation: false @@ -266,7 +277,7 @@ Gemspec/RubyVersionGlobalsUsage: Layout/AccessModifierIndentation: Description: Check indentation of private/protected visibility modifiers. StyleGuide: "#indent-public-private-protected" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: indent SupportedStyles: @@ -276,7 +287,7 @@ Layout/AccessModifierIndentation: Layout/ArgumentAlignment: Description: Align the arguments of a method call if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: with_fixed_indentation @@ -287,7 +298,7 @@ Layout/ArgumentAlignment: Layout/ArrayAlignment: Description: Align the elements of an array literal if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: with_first_element @@ -298,13 +309,13 @@ Layout/ArrayAlignment: Layout/AssignmentIndentation: Description: Checks the indentation of the first line of the right-hand-side of a multi-line assignment. - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.45' IndentationWidth: Layout/BeginEndAlignment: Description: Align ends corresponding to begins correctly. - Enabled: true + Enabled: false VersionAdded: '0.91' EnforcedStyleAlignWith: start_of_line SupportedStylesAlignWith: @@ -313,7 +324,7 @@ Layout/BeginEndAlignment: Severity: warning Layout/BlockAlignment: Description: Align block ends correctly. - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleAlignWith: either SupportedStylesAlignWith: @@ -322,12 +333,12 @@ Layout/BlockAlignment: - start_of_line Layout/BlockEndNewline: Description: Put end statement of multiline block on its own line. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/CaseIndentation: Description: Indentation of when in a case/(when|in)/[else/]end. StyleGuide: "#indent-when-to-case" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.16' EnforcedStyle: end @@ -358,15 +369,15 @@ Layout/ClassStructure: - private_methods Layout/ClosingHeredocIndentation: Description: Checks the indentation of here document closings. - Enabled: true + Enabled: false VersionAdded: '0.57' Layout/ClosingParenthesisIndentation: Description: Checks the indentation of hanging closing parentheses. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/CommentIndentation: Description: Indentation of comments. - Enabled: true + Enabled: false AllowForAlignment: false VersionAdded: '0.49' VersionChanged: '1.24' @@ -374,12 +385,12 @@ Layout/ConditionPosition: Description: Checks for condition placed in a confusing position relative to the keyword. StyleGuide: "#same-line-condition" - Enabled: true + Enabled: false VersionAdded: '0.53' VersionChanged: '0.83' Layout/DefEndAlignment: Description: Align ends corresponding to defs correctly. - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleAlignWith: start_of_line SupportedStylesAlignWith: @@ -389,7 +400,7 @@ Layout/DefEndAlignment: Layout/DotPosition: Description: Checks the position of the dot in multi-line method calls. StyleGuide: "#consistent-multi-line-chains" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: leading SupportedStyles: @@ -397,11 +408,11 @@ Layout/DotPosition: - trailing Layout/ElseAlignment: Description: Align elses and elsifs correctly. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyComment: Description: Checks empty comment. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.53' VersionChanged: '1.61' @@ -409,13 +420,13 @@ Layout/EmptyComment: AllowMarginComment: true Layout/EmptyLineAfterGuardClause: Description: Add empty line after guard clause. - Enabled: true + Enabled: false VersionAdded: '0.56' VersionChanged: '0.59' Layout/EmptyLineAfterMagicComment: Description: Add an empty line after magic comments to separate them from code. StyleGuide: "#separate-magic-comments-from-code" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLineAfterMultilineCondition: Description: Enforces empty line after multiline condition. @@ -426,7 +437,7 @@ Layout/EmptyLineAfterMultilineCondition: Layout/EmptyLineBetweenDefs: Description: Use empty lines between class/module/method defs. StyleGuide: "#empty-lines-between-methods" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.23' EmptyLineBetweenMethodDefs: true @@ -438,12 +449,12 @@ Layout/EmptyLineBetweenDefs: Layout/EmptyLines: Description: Don't use several empty lines in a row. StyleGuide: "#two-or-more-empty-lines" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundAccessModifier: Description: Keep blank lines around access modifiers. StyleGuide: "#empty-lines-around-access-modifier" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: around SupportedStyles: @@ -453,12 +464,12 @@ Layout/EmptyLinesAroundAccessModifier: - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions Layout/EmptyLinesAroundArguments: Description: Keeps track of empty lines around method arguments. - Enabled: true + Enabled: false VersionAdded: '0.52' Layout/EmptyLinesAroundAttributeAccessor: Description: Keep blank lines around attribute accessors. StyleGuide: "#empty-lines-around-attribute-accessor" - Enabled: true + Enabled: false VersionAdded: '0.83' VersionChanged: '0.84' AllowAliasSyntax: true @@ -470,12 +481,12 @@ Layout/EmptyLinesAroundAttributeAccessor: Layout/EmptyLinesAroundBeginBody: Description: Keeps track of empty lines around begin-end bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundBlockBody: Description: Keeps track of empty lines around block bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: no_empty_lines SupportedStyles: @@ -484,7 +495,7 @@ Layout/EmptyLinesAroundBlockBody: Layout/EmptyLinesAroundClassBody: Description: Keeps track of empty lines around class bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.53' EnforcedStyle: no_empty_lines @@ -498,17 +509,17 @@ Layout/EmptyLinesAroundClassBody: Layout/EmptyLinesAroundExceptionHandlingKeywords: Description: Keeps track of empty lines around exception handling keywords. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundMethodBody: Description: Keeps track of empty lines around method bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/EmptyLinesAroundModuleBody: Description: Keeps track of empty lines around module bodies. StyleGuide: "#empty-lines-around-bodies" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: no_empty_lines SupportedStyles: @@ -518,7 +529,7 @@ Layout/EmptyLinesAroundModuleBody: - no_empty_lines Layout/EndAlignment: Description: Align ends correctly. - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleAlignWith: variable SupportedStylesAlignWith: @@ -529,7 +540,7 @@ Layout/EndAlignment: Layout/EndOfLine: Description: Use Unix-style line endings. StyleGuide: "#crlf" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: native SupportedStyles: @@ -538,14 +549,14 @@ Layout/EndOfLine: - crlf Layout/ExtraSpacing: Description: Do not use unnecessary spacing. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowForAlignment: true AllowBeforeTrailingComments: false ForceEqualSignAlignment: false Layout/FirstArgumentIndentation: Description: Checks the indentation of the first argument in a method call. - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: consistent @@ -557,7 +568,7 @@ Layout/FirstArgumentIndentation: IndentationWidth: Layout/FirstArrayElementIndentation: Description: Checks the indentation of the first element in an array literal. - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: consistent @@ -568,12 +579,12 @@ Layout/FirstArrayElementIndentation: IndentationWidth: Layout/FirstArrayElementLineBreak: Description: Checks for a line break before the first element in a multi-line array. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: true Layout/FirstHashElementIndentation: Description: Checks the indentation of the first key in a hash literal. - Enabled: true + Enabled: false VersionAdded: '0.68' VersionChanged: '0.77' EnforcedStyle: consistent @@ -584,15 +595,16 @@ Layout/FirstHashElementIndentation: IndentationWidth: Layout/FirstHashElementLineBreak: Description: Checks for a line break before the first element in a multi-line hash. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: false Layout/FirstMethodArgumentLineBreak: Description: Checks for a line break before the first argument in a multi-line method call. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowMultilineFinalElement: true + AllowedMethods: [] Layout/FirstMethodParameterLineBreak: Description: Checks for a line break before the first parameter in a multi-line method parameter definition. @@ -601,7 +613,7 @@ Layout/FirstMethodParameterLineBreak: AllowMultilineFinalElement: false Layout/FirstParameterIndentation: Description: Checks the indentation of the first parameter in a method definition. - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: consistent @@ -611,7 +623,7 @@ Layout/FirstParameterIndentation: IndentationWidth: Layout/HashAlignment: Description: Align the elements of a hash literal if they span more than one line. - Enabled: true + Enabled: false AllowMultipleStyles: true VersionAdded: '0.49' VersionChanged: '1.16' @@ -640,13 +652,13 @@ Layout/HeredocArgumentClosingParenthesis: Layout/HeredocIndentation: Description: Checks the indentation of the here document bodies. StyleGuide: "#squiggly-heredocs" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.85' Layout/IndentationConsistency: Description: Keep indentation straight. StyleGuide: "#spaces-indentation" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: normal SupportedStyles: @@ -657,7 +669,7 @@ Layout/IndentationConsistency: Layout/IndentationStyle: Description: Consistent indentation either with tabs only or spaces only. StyleGuide: "#spaces-indentation" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.82' IndentationWidth: @@ -668,32 +680,34 @@ Layout/IndentationStyle: Layout/IndentationWidth: Description: Use 2 spaces for indentation. StyleGuide: "#spaces-indentation" - Enabled: true + Enabled: false VersionAdded: '0.49' Width: 2 AllowedPatterns: [] Layout/InitialIndentation: Description: Checks the indentation of the first non-blank non-comment line in a file. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/LeadingCommentSpace: Description: Comments should start with a space. StyleGuide: "#hash-space" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.73' AllowDoxygenCommentStyle: false AllowGemfileRubyComment: false + AllowRBSInlineAnnotation: false + AllowSteepAnnotation: false Layout/LeadingEmptyLines: Description: Check for unnecessary blank lines at the beginning of a file. - Enabled: true + Enabled: false VersionAdded: '0.57' VersionChanged: '0.77' Layout/LineContinuationLeadingSpace: Description: Use trailing spaces instead of leading spaces in strings broken over multiple lines (by a backslash). - Enabled: true + Enabled: false VersionAdded: '1.31' VersionChanged: '1.45' EnforcedStyle: trailing @@ -702,7 +716,7 @@ Layout/LineContinuationLeadingSpace: - trailing Layout/LineContinuationSpacing: Description: Checks the spacing in front of backslash in line continuations. - Enabled: true + Enabled: false VersionAdded: '1.31' EnforcedStyle: space SupportedStyles: @@ -711,7 +725,7 @@ Layout/LineContinuationSpacing: Layout/LineEndStringConcatenationIndentation: Description: Checks the indentation of the next line after a line that ends with a string literal and a backslash. - Enabled: true + Enabled: false VersionAdded: '1.18' EnforcedStyle: indented SupportedStyles: @@ -721,9 +735,9 @@ Layout/LineEndStringConcatenationIndentation: Layout/LineLength: Description: Checks that line length does not exceed the configured limit. StyleGuide: "#max-line-length" - Enabled: true + Enabled: false VersionAdded: '0.25' - VersionChanged: '1.4' + VersionChanged: '1.69' Max: 120 AllowHeredoc: true AllowURI: true @@ -734,10 +748,11 @@ Layout/LineLength: AllowedPatterns: - "\\A\\s*(remote_)?test(_\\w+)?\\s.*(do|->)(\\s|\\Z)" - "\\A\\s*def test_\\w+\\s*\\Z" + SplitStrings: false Layout/MultilineArrayBraceLayout: Description: Checks that the closing brace in an array literal is either on the same line as the last array element, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -747,7 +762,7 @@ Layout/MultilineArrayBraceLayout: Layout/MultilineArrayLineBreaks: Description: Checks that each item in a multi-line array literal starts on a separate line. - Enabled: true + Enabled: false VersionAdded: '0.67' AllowMultilineFinalElement: true Layout/MultilineAssignmentLayout: @@ -768,12 +783,12 @@ Layout/MultilineAssignmentLayout: - new_line Layout/MultilineBlockLayout: Description: Ensures newlines after multiline block do statements. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/MultilineHashBraceLayout: Description: Checks that the closing brace in a hash literal is either on the same line as the last hash element, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -783,19 +798,19 @@ Layout/MultilineHashBraceLayout: Layout/MultilineHashKeyLineBreaks: Description: Checks that each item in a multi-line hash literal starts on a separate line. - Enabled: true + Enabled: false VersionAdded: '0.67' AllowMultilineFinalElement: false Layout/MultilineMethodArgumentLineBreaks: Description: Checks that each argument in a multi-line method call starts on a separate line. - Enabled: true + Enabled: false VersionAdded: '0.67' AllowMultilineFinalElement: true Layout/MultilineMethodCallBraceLayout: Description: Checks that the closing brace in a method call is either on the same line as the last method argument, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -805,18 +820,18 @@ Layout/MultilineMethodCallBraceLayout: Layout/MultilineMethodCallIndentation: Description: Checks indentation of method calls with the dot operator that span more than one line. - Enabled: true + Enabled: false VersionAdded: '0.49' - EnforcedStyle: indented + EnforcedStyle: aligned SupportedStyles: - aligned - indented - indented_relative_to_receiver - IndentationWidth: 2 + IndentationWidth: Layout/MultilineMethodDefinitionBraceLayout: Description: Checks that the closing brace in a method definition is either on the same line as the last method parameter, or a new line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: symmetrical SupportedStyles: @@ -831,7 +846,7 @@ Layout/MultilineMethodParameterLineBreaks: AllowMultilineFinalElement: false Layout/MultilineOperationIndentation: Description: Checks indentation of binary operations that span more than one line. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: indented SupportedStyles: @@ -842,7 +857,7 @@ Layout/ParameterAlignment: Description: Align the parameters of a method definition if they span more than one line. StyleGuide: "#no-double-indent" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: with_fixed_indentation @@ -858,7 +873,7 @@ Layout/RedundantLineBreak: VersionAdded: '1.13' Layout/RescueEnsureAlignment: Description: Align rescues and ensures correctly. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SingleLineBlockChain: Description: Put method call on a separate line if chained to a single line block. @@ -867,32 +882,32 @@ Layout/SingleLineBlockChain: Layout/SpaceAfterColon: Description: Use spaces after colons. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterComma: Description: Use spaces after commas. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterMethodName: Description: Do not put a space between a method name and the opening parenthesis in a method definition. StyleGuide: "#parens-no-spaces" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterNot: Description: Tracks redundant space after the ! operator. StyleGuide: "#no-space-bang" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAfterSemicolon: Description: Use spaces after semicolons. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAroundBlockParameters: Description: Checks the spacing inside and after block parameters pipes. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyleInsidePipes: no_space SupportedStylesInsidePipes: @@ -902,7 +917,7 @@ Layout/SpaceAroundEqualsInParameterDefault: Description: Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration. StyleGuide: "#spaces-around-equals" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -910,16 +925,16 @@ Layout/SpaceAroundEqualsInParameterDefault: - no_space Layout/SpaceAroundKeyword: Description: Use a space around keywords if appropriate. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceAroundMethodCallOperator: Description: Checks method call operators to not have spaces around them. - Enabled: true + Enabled: false VersionAdded: '0.82' Layout/SpaceAroundOperators: Description: Use a single space around operators. StyleGuide: "#spaces-operators" - Enabled: true + Enabled: false VersionAdded: '0.49' AllowForAlignment: true EnforcedStyleForExponentOperator: no_space @@ -932,7 +947,7 @@ Layout/SpaceAroundOperators: - no_space Layout/SpaceBeforeBlockBraces: Description: Checks that the left block brace has or doesn't have space before it. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -946,29 +961,29 @@ Layout/SpaceBeforeBlockBraces: Layout/SpaceBeforeBrackets: Description: Checks for receiver with a space before the opening brackets. StyleGuide: "#space-in-brackets-access" - Enabled: true + Enabled: false VersionAdded: '1.7' Layout/SpaceBeforeComma: Description: No spaces before commas. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceBeforeComment: Description: Checks for missing space between code and a comment on the same line. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceBeforeFirstArg: Description: Checks that exactly one space is used between a method name and the first argument for method calls without parentheses. - Enabled: true + Enabled: false VersionAdded: '0.49' AllowForAlignment: true Layout/SpaceBeforeSemicolon: Description: No spaces before semicolons. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInLambdaLiteral: Description: Checks for spaces in lambda literals. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: require_no_space SupportedStyles: @@ -976,7 +991,7 @@ Layout/SpaceInLambdaLiteral: - require_space Layout/SpaceInsideArrayLiteralBrackets: Description: Checks the spacing inside array literal brackets. - Enabled: true + Enabled: false VersionAdded: '0.52' EnforcedStyle: no_space SupportedStyles: @@ -989,13 +1004,13 @@ Layout/SpaceInsideArrayLiteralBrackets: - no_space Layout/SpaceInsideArrayPercentLiteral: Description: No unnecessary additional spaces between elements in %i/%w literals. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInsideBlockBraces: Description: Checks that block braces have or don't have surrounding space. For blocks taking parameters, checks that the left brace has or doesn't have trailing space. - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -1009,7 +1024,7 @@ Layout/SpaceInsideBlockBraces: Layout/SpaceInsideHashLiteralBraces: Description: Use spaces inside hash literal braces - or don't. StyleGuide: "#spaces-braces" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: space SupportedStyles: @@ -1023,7 +1038,7 @@ Layout/SpaceInsideHashLiteralBraces: Layout/SpaceInsideParens: Description: No spaces after ( or before ). StyleGuide: "#spaces-braces" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.22' EnforcedStyle: no_space @@ -1033,16 +1048,16 @@ Layout/SpaceInsideParens: - no_space Layout/SpaceInsidePercentLiteralDelimiters: Description: No unnecessary spaces inside delimiters of %i/%w/%x literals. - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInsideRangeLiteral: Description: No spaces inside range literals. StyleGuide: "#no-space-inside-range-literals" - Enabled: true + Enabled: false VersionAdded: '0.49' Layout/SpaceInsideReferenceBrackets: Description: Checks the spacing inside referential brackets. - Enabled: true + Enabled: false VersionAdded: '0.52' VersionChanged: '0.53' EnforcedStyle: no_space @@ -1056,7 +1071,7 @@ Layout/SpaceInsideReferenceBrackets: Layout/SpaceInsideStringInterpolation: Description: Checks for padding/surrounding spaces inside string interpolation. StyleGuide: "#string-interpolation" - Enabled: true + Enabled: false VersionAdded: '0.49' EnforcedStyle: no_space SupportedStyles: @@ -1065,7 +1080,7 @@ Layout/SpaceInsideStringInterpolation: Layout/TrailingEmptyLines: Description: Checks trailing blank lines and final newline. StyleGuide: "#newline-eof" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '0.77' EnforcedStyle: final_newline @@ -1075,7 +1090,7 @@ Layout/TrailingEmptyLines: Layout/TrailingWhitespace: Description: Avoid trailing whitespace. StyleGuide: "#no-trailing-whitespace" - Enabled: true + Enabled: false VersionAdded: '0.49' VersionChanged: '1.0' AllowInHeredoc: false @@ -1095,7 +1110,7 @@ Lint/AmbiguousOperator: Description: Checks for ambiguous operators in the first argument of a method invocation without parentheses. StyleGuide: "#method-invocation-parens" - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '0.83' Lint/AmbiguousOperatorPrecedence: @@ -1112,27 +1127,32 @@ Lint/AmbiguousRange: Lint/AmbiguousRegexpLiteral: Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses. - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '0.83' +Lint/ArrayLiteralInRegexp: + Description: Checks for an array literal interpolated inside a regexp. + Enabled: false + VersionAdded: '1.71' + SafeAutoCorrect: false Lint/AssignmentInCondition: Description: Don't use assignment in conditions. StyleGuide: "#safe-assignment-in-condition" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.9' VersionChanged: '1.45' AllowSafeAssignment: true Lint/BigDecimalNew: Description: "`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead." - Enabled: true + Enabled: false VersionAdded: '0.53' Lint/BinaryOperatorWithIdenticalOperands: Description: Checks for places where binary operator has identical operands. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.89' - VersionChanged: '1.7' + VersionChanged: '1.69' Lint/BooleanSymbol: Description: Check for `:true` and `:false` symbols. Enabled: false @@ -1142,7 +1162,7 @@ Lint/BooleanSymbol: Lint/CircularArgumentReference: Description: Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument. - Enabled: true + Enabled: false VersionAdded: '0.33' Lint/ConstantDefinitionInBlock: Description: Do not define constants within a block. @@ -1155,8 +1175,12 @@ Lint/ConstantDefinitionInBlock: Lint/ConstantOverwrittenInRescue: Description: Checks for overwriting an exception with an exception result by use `rescue =>`. - Enabled: true + Enabled: false VersionAdded: '1.31' +Lint/ConstantReassignment: + Description: Checks for constant reassignments. + Enabled: false + VersionAdded: '1.70' Lint/ConstantResolution: Description: Check that constants are fully qualified with `::`. Enabled: false @@ -1165,7 +1189,7 @@ Lint/ConstantResolution: Ignore: [] Lint/Debugger: Description: Check for debugger calls. - Enabled: true + Enabled: false VersionAdded: '0.14' VersionChanged: '1.63' DebuggerMethods: @@ -1213,7 +1237,7 @@ Lint/Debugger: - debug/start Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. - Enabled: true + Enabled: false VersionAdded: '0.19' Lint/DeprecatedConstants: Description: Checks for deprecated constants. @@ -1244,7 +1268,7 @@ Lint/DeprecatedConstants: DeprecatedVersion: '3.0' Lint/DeprecatedOpenSSLConstant: Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`. - Enabled: true + Enabled: false VersionAdded: '0.84' Lint/DisjunctiveAssignmentInConstructor: Description: In constructor, plain assignment is preferred over disjunctive. @@ -1260,9 +1284,10 @@ Lint/DuplicateBranch: VersionChanged: '1.7' IgnoreLiteralBranches: false IgnoreConstantBranches: false + IgnoreDuplicateElseBranch: false Lint/DuplicateCaseCondition: Description: Do not repeat values in case conditionals. - Enabled: true + Enabled: false VersionAdded: '0.45' Lint/DuplicateElsifCondition: Description: Do not repeat conditions used in if `elsif`. @@ -1270,20 +1295,20 @@ Lint/DuplicateElsifCondition: VersionAdded: '0.88' Lint/DuplicateHashKey: Description: Check for duplicate keys in hash literals. - Enabled: true + Enabled: false VersionAdded: '0.34' VersionChanged: '0.77' Lint/DuplicateMagicComment: Description: Check for duplicated magic comments. - Enabled: true + Enabled: false VersionAdded: '1.37' Lint/DuplicateMatchPattern: Description: Do not repeat patterns in `in` keywords. - Enabled: true + Enabled: false VersionAdded: '1.50' Lint/DuplicateMethods: Description: Check for duplicate method definitions. - Enabled: true + Enabled: false VersionAdded: '0.29' Lint/DuplicateRegexpCharacterClassElement: Description: Checks for duplicate elements in Regexp character classes. @@ -1299,13 +1324,17 @@ Lint/DuplicateRescueException: Description: Checks that there are no repeated exceptions used in `rescue` expressions. Enabled: false VersionAdded: '0.89' +Lint/DuplicateSetElement: + Description: Checks for duplicate elements in Set. + Enabled: false + VersionAdded: '1.67' Lint/EachWithObjectArgument: Description: Check for immutable argument given to each_with_object. - Enabled: true + Enabled: false VersionAdded: '0.31' Lint/ElseLayout: Description: Check for odd code arrangement in an else block. - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '1.2' Lint/EmptyBlock: @@ -1331,7 +1360,7 @@ Lint/EmptyConditionalBody: VersionChanged: '1.61' Lint/EmptyEnsure: Description: Checks for empty ensure block. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.10' VersionChanged: '1.61' @@ -1351,7 +1380,7 @@ Lint/EmptyInPattern: VersionAdded: '1.16' Lint/EmptyInterpolation: Description: Checks for empty string interpolation. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.20' VersionChanged: '1.61' @@ -1364,7 +1393,7 @@ Lint/EmptyWhen: Lint/EnsureReturn: Description: Do not use return in an ensure block. StyleGuide: "#no-return-ensure" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.83' Lint/ErbNewArguments: @@ -1374,7 +1403,7 @@ Lint/ErbNewArguments: Lint/FlipFlop: Description: Checks for flip-flops. StyleGuide: "#no-flip-flops" - Enabled: true + Enabled: false VersionAdded: '0.16' Lint/FloatComparison: Description: Checks for the presence of precise comparison of floating point numbers. @@ -1383,11 +1412,11 @@ Lint/FloatComparison: VersionAdded: '0.89' Lint/FloatOutOfRange: Description: Catches floating-point literals too large or small for Ruby to represent. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/FormatParameterMismatch: Description: The number of parameters to format/sprint must match the fields. - Enabled: true + Enabled: false VersionAdded: '0.33' Lint/HashCompareByIdentity: Description: Prefer using `Hash#compare_by_identity` than using `object_id` for @@ -1396,6 +1425,11 @@ Lint/HashCompareByIdentity: Enabled: false Safe: false VersionAdded: '0.93' +Lint/HashNewWithKeywordArgumentsAsDefault: + Description: Checks for the deprecated use of keyword arguments for hash default + in `Hash.new`. + Enabled: false + VersionAdded: '1.69' Lint/HeredocMethodCallPosition: Description: Checks for the ordering of a method call where the receiver of the call is a HEREDOC. @@ -1410,7 +1444,7 @@ Lint/IdentityComparison: Lint/ImplicitStringConcatenation: Description: Checks for adjacent string literals on the same line, which could better be represented as a single string literal. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/IncompatibleIoSelectWithFiberScheduler: Description: Checks for `IO.select` that is incompatible with Fiber Scheduler. @@ -1421,11 +1455,11 @@ Lint/IncompatibleIoSelectWithFiberScheduler: Lint/IneffectiveAccessModifier: Description: Checks for attempts to use `private` or `protected` to set the visibility of a class method, which does not work. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/InheritException: Description: Avoid inheriting from the `Exception` class. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.41' VersionChanged: '1.26' @@ -1442,7 +1476,7 @@ Lint/InterpolationCheck: Lint/ItWithoutArgumentsInBlock: Description: Checks uses of `it` calls without arguments in block. Reference: https://bugs.ruby-lang.org/issues/18980 - Enabled: true + Enabled: false VersionAdded: '1.59' Lint/LambdaWithoutLiteralBlock: Description: Checks uses of lambda without a literal block. @@ -1450,41 +1484,41 @@ Lint/LambdaWithoutLiteralBlock: VersionAdded: '1.8' Lint/LiteralAsCondition: Description: Checks of literals used in conditions. - Enabled: true + Enabled: false VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: Description: Checks for literal assignments in the conditions. - Enabled: true + Enabled: false VersionAdded: '1.58' Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.32' Lint/Loop: Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests. StyleGuide: "#loop-with-break" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.3' Safe: false Lint/MissingCopEnableDirective: Description: Checks for a `# rubocop:enable` after `# rubocop:disable`. - Enabled: true + Enabled: false VersionAdded: '0.52' MaximumRangeSize: .inf Lint/MissingSuper: Description: Checks for the presence of constructors and lifecycle callbacks without calls to `super`. - Enabled: true + Enabled: false AllowedParentClasses: [] VersionAdded: '0.89' VersionChanged: '1.4' Lint/MixedCaseRange: Description: Checks for mixed-case character ranges since they include likely unintended characters. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '1.53' Lint/MixedRegexpCaptureTypes: @@ -1499,7 +1533,7 @@ Lint/MultipleComparison: Lint/NestedMethodDefinition: Description: Do not use nested method definitions. StyleGuide: "#no-nested-methods" - Enabled: true + Enabled: false AllowedMethods: [] AllowedPatterns: [] VersionAdded: '0.32' @@ -1510,11 +1544,11 @@ Lint/NestedPercentLiteral: Lint/NextWithoutAccumulator: Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/NoReturnInBeginEndBlocks: Description: Do not `return` inside `begin..end` blocks in assignment contexts. - Enabled: true + Enabled: false VersionAdded: '1.2' Lint/NonAtomicFileOperation: Description: Checks for non-atomic file operations. @@ -1529,7 +1563,7 @@ Lint/NonDeterministicRequireOrder: Safe: false Lint/NonLocalExitFromIterator: Description: Do not use return in iterator to cause non-local exit. - Enabled: true + Enabled: false VersionAdded: '0.30' Lint/NumberConversion: Description: Checks unsafe usage of number conversion methods. @@ -1546,6 +1580,10 @@ Lint/NumberedParameterAssignment: Description: Checks for uses of numbered parameter assignment. Enabled: false VersionAdded: '1.9' +Lint/NumericOperationWithConstantResult: + Description: Checks for numeric operations with constant results. + Enabled: false + VersionAdded: '1.69' Lint/OrAssignmentToConstant: Description: Checks unintended or-assignment to constant. Enabled: false @@ -1554,7 +1592,7 @@ Lint/OrAssignmentToConstant: Lint/OrderedMagicComments: Description: Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.53' VersionChanged: '1.37' @@ -1567,17 +1605,17 @@ Lint/OutOfRangeRegexpRef: Lint/ParenthesesAsGroupedExpression: Description: Checks for method calls with a space before the opening parenthesis. StyleGuide: "#parens-no-spaces" - Enabled: true + Enabled: false VersionAdded: '0.12' VersionChanged: '0.83' Lint/PercentStringArray: Description: Checks for unwanted commas and quotes in %w/%W literals. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.41' Lint/PercentSymbolArray: Description: Checks for unwanted commas and colons in %i/%I literals. - Enabled: true + Enabled: false VersionAdded: '0.41' Lint/RaiseException: Description: Checks for `raise` or `fail` statements which are raising `Exception` @@ -1592,16 +1630,16 @@ Lint/RaiseException: Lint/RandOne: Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake. - Enabled: true + Enabled: false VersionAdded: '0.36' Lint/RedundantCopDisableDirective: Description: 'Checks for rubocop:disable comments that can be removed. Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.' - Enabled: true + Enabled: false VersionAdded: '0.76' Lint/RedundantCopEnableDirective: Description: Checks for rubocop:enable comments that can be removed. - Enabled: true + Enabled: false VersionAdded: '0.76' Lint/RedundantDirGlobSort: Description: Checks for redundant `sort` method to `Dir.glob` and `Dir[]`. @@ -1611,7 +1649,7 @@ Lint/RedundantDirGlobSort: SafeAutoCorrect: false Lint/RedundantRegexpQuantifiers: Description: Checks for redundant quantifiers in Regexps. - Enabled: true + Enabled: false VersionAdded: '1.53' Lint/RedundantRequireStatement: Description: Checks for unnecessary `require` statement. @@ -1633,14 +1671,14 @@ Lint/RedundantSafeNavigation: Safe: false Lint/RedundantSplatExpansion: Description: Checks for splat unnecessarily being called on literals. - Enabled: true + Enabled: false VersionAdded: '0.76' VersionChanged: '1.7' AllowPercentLiteralArrayArgument: true Lint/RedundantStringCoercion: Description: Checks for Object#to_s usage in string interpolation. StyleGuide: "#no-to-s" - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.77' Lint/RedundantWithIndex: @@ -1665,21 +1703,21 @@ Lint/RegexpAsCondition: VersionChanged: '0.86' Lint/RequireParentheses: Description: Use parentheses in the method call to avoid confusion about precedence. - Enabled: true + Enabled: false VersionAdded: '0.18' Lint/RequireRangeParentheses: Description: Checks that a range literal is enclosed in parentheses when the end of the range is at a line break. - Enabled: true + Enabled: false VersionAdded: '1.32' Lint/RequireRelativeSelfPath: Description: Checks for uses a file requiring itself with `require_relative`. - Enabled: true + Enabled: false VersionAdded: '1.22' Lint/RescueException: Description: Avoid rescuing the Exception class. StyleGuide: "#no-blind-rescues" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.27' Lint/RescueType: @@ -1692,7 +1730,7 @@ Lint/ReturnInVoidContext: VersionAdded: '0.50' Lint/SafeNavigationChain: Description: Do not chain ordinary method call after safe navigation operator. - Enabled: true + Enabled: false VersionAdded: '0.47' VersionChanged: '0.77' AllowedMethods: @@ -1703,9 +1741,9 @@ Lint/SafeNavigationChain: - try! - in? Lint/SafeNavigationConsistency: - Description: Check to make sure that if safe navigation is used for a method call - in an `&&` or `||` condition that safe navigation is used for all method calls - on that same object. + Description: Check to make sure that if safe navigation is used in an `&&` or `||` + condition, consistent and appropriate safe navigation, without excess or deficiency, + is used for all method calls on the same object. Enabled: false VersionAdded: '0.55' VersionChanged: '0.77' @@ -1740,13 +1778,18 @@ Lint/ShadowedArgument: IgnoreImplicitReferences: false Lint/ShadowedException: Description: Avoid rescuing a higher level exception before a lower level exception. - Enabled: true + Enabled: false VersionAdded: '0.41' Lint/ShadowingOuterLocalVariable: Description: Do not use the same name as outer local variable for block arguments or block local variables. Enabled: false VersionAdded: '0.9' +Lint/SharedMutableDefault: + Description: Checks for mutable literals used as default arguments during Hash initialization. + StyleGuide: "#no-mutable-defaults" + Enabled: false + VersionAdded: '1.70' Lint/StructNewOverride: Description: Disallow overriding the `Struct` built-in methods via `Struct.new`. Enabled: false @@ -1754,7 +1797,7 @@ Lint/StructNewOverride: Lint/SuppressedException: Description: Don't suppress exceptions. StyleGuide: "#dont-hide-exceptions" - Enabled: true + Enabled: false AllowComments: true AllowNil: true VersionAdded: '0.9' @@ -1799,9 +1842,13 @@ Lint/TripleQuotes: VersionAdded: '1.9' Lint/UnderscorePrefixedVariableName: Description: Do not use prefix `_` for a variable that is used. - Enabled: true + Enabled: false VersionAdded: '0.21' AllowKeywordBlockArguments: false +Lint/UnescapedBracketInRegexp: + Description: Checks for unescaped literal `]` in Regexp. + Enabled: false + VersionAdded: '1.68' Lint/UnexpectedBlockArity: Description: Looks for blocks that have fewer arguments that the calling method expects. @@ -1821,7 +1868,7 @@ Lint/UnexpectedBlockArity: sort: 2 Lint/UnifiedInteger: Description: Use Integer instead of Fixnum or Bignum. - Enabled: true + Enabled: false VersionAdded: '0.43' Lint/UnmodifiedReduceAccumulator: Description: Checks for `reduce` or `inject` blocks that do not update the accumulator @@ -1831,7 +1878,7 @@ Lint/UnmodifiedReduceAccumulator: VersionChanged: '1.5' Lint/UnreachableCode: Description: Unreachable code. - Enabled: true + Enabled: false VersionAdded: '0.9' Lint/UnreachableLoop: Description: Checks for loops that will have at most one iteration. @@ -1843,7 +1890,7 @@ Lint/UnreachableLoop: Lint/UnusedBlockArgument: Description: Checks for unused block arguments. StyleGuide: "#underscore-unused-vars" - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.21' VersionChanged: '1.61' @@ -1855,10 +1902,12 @@ Lint/UnusedMethodArgument: Enabled: false AutoCorrect: contextual VersionAdded: '0.21' - VersionChanged: '1.61' + VersionChanged: '1.69' AllowUnusedKeywordArguments: false IgnoreEmptyMethods: true IgnoreNotImplementedMethods: true + NotImplementedExceptions: + - NotImplementedError Lint/UriEscapeUnescape: Description: "`URI.escape` method is obsolete and should not be used. Instead, use `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component` depending @@ -1873,7 +1922,7 @@ Lint/UriRegexp: VersionAdded: '0.50' Lint/UselessAccessModifier: Description: Checks for useless access modifiers. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.20' VersionChanged: '1.61' @@ -1882,14 +1931,18 @@ Lint/UselessAccessModifier: Lint/UselessAssignment: Description: Checks for useless assignment to a local variable. StyleGuide: "#underscore-unused-vars" - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.11' - VersionChanged: '1.61' - SafeAutoCorrect: false + VersionChanged: '1.66' +Lint/UselessDefined: + Description: Checks for calls to `defined?` with strings and symbols. The result + of such a call will always be truthy. + Enabled: false + VersionAdded: '1.69' Lint/UselessElseWithoutRescue: Description: Checks for useless `else` in `begin..end` without `rescue`. - Enabled: true + Enabled: false VersionAdded: '0.17' VersionChanged: '1.31' Lint/UselessMethodDefinition: @@ -1899,17 +1952,21 @@ Lint/UselessMethodDefinition: VersionAdded: '0.90' VersionChanged: '1.61' Safe: false +Lint/UselessNumericOperation: + Description: Checks for useless numeric operations. + Enabled: false + VersionAdded: '1.66' Lint/UselessRescue: Description: Checks for useless `rescue`s. - Enabled: true + Enabled: false VersionAdded: '1.43' Lint/UselessRuby2Keywords: Description: Finds unnecessary uses of `ruby2_keywords`. - Enabled: true + Enabled: false VersionAdded: '1.23' Lint/UselessSetterCall: Description: Checks for useless setter call to a local variable. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.13' VersionChanged: '1.2' @@ -1922,7 +1979,7 @@ Lint/UselessTimes: VersionChanged: '1.61' Lint/Void: Description: Possible use of operator/literal/variable in void context. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.9' VersionChanged: '1.61' @@ -1956,10 +2013,11 @@ Metrics/BlockLength: Metrics/BlockNesting: Description: Avoid excessive block nesting. StyleGuide: "#three-is-the-number-thou-shalt-count" - Enabled: true + Enabled: false VersionAdded: '0.25' - VersionChanged: '0.47' + VersionChanged: '1.65' CountBlocks: false + CountModifierForms: false Max: 3 Metrics/ClassLength: Description: Avoid classes longer than 100 lines of code. @@ -1971,7 +2029,7 @@ Metrics/ClassLength: CountAsOne: [] Metrics/CollectionLiteralLength: Description: Checks for `Array` or `Hash` literals with many entries. - Enabled: true + Enabled: false VersionAdded: '1.47' LengthThreshold: 250 Metrics/CyclomaticComplexity: @@ -2005,7 +2063,7 @@ Metrics/ModuleLength: Metrics/ParameterLists: Description: Avoid parameter lists longer than three or four parameters. StyleGuide: "#too-many-params" - Enabled: true + Enabled: false VersionAdded: '0.25' VersionChanged: '1.5' Max: 5 @@ -2028,19 +2086,19 @@ Migration/DepartmentName: Naming/AccessorMethodName: Description: Check the naming of accessor methods for get_/set_. StyleGuide: "#accessor_mutator_method_names" - Enabled: true + Enabled: false VersionAdded: '0.50' Naming/AsciiIdentifiers: Description: Use only ascii symbols in identifiers and constants. StyleGuide: "#english-identifiers" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '0.87' AsciiConstants: true Naming/BinaryOperatorParameterName: Description: When defining binary operators, name the argument other. StyleGuide: "#other-arg" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.2' Naming/BlockForwarding: @@ -2066,7 +2124,7 @@ Naming/BlockParameterName: Naming/ClassAndModuleCamelCase: Description: Use CamelCase for classes and modules. StyleGuide: "#camelcase-classes" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '0.85' AllowedNames: @@ -2074,12 +2132,12 @@ Naming/ClassAndModuleCamelCase: Naming/ConstantName: Description: Constants should use SCREAMING_SNAKE_CASE. StyleGuide: "#screaming-snake-case" - Enabled: true + Enabled: false VersionAdded: '0.50' Naming/FileName: Description: Use snake_case for source file names. StyleGuide: "#snake-case-files" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.23' Exclude: @@ -2194,7 +2252,7 @@ Naming/MemoizedInstanceVariableName: Naming/MethodName: Description: Use the configured style when naming methods. StyleGuide: "#snake-case-symbols-methods-vars" - Enabled: true + Enabled: false VersionAdded: '0.50' EnforcedStyle: snake_case SupportedStyles: @@ -2230,7 +2288,7 @@ Naming/MethodParameterName: Naming/PredicateName: Description: Check the names of predicate methods. StyleGuide: "#bool-methods-qmark" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '0.77' NamePrefix: @@ -2253,7 +2311,7 @@ Naming/RescuedExceptionsVariableName: Naming/VariableName: Description: Use the configured style when naming variables. StyleGuide: "#snake-case-symbols-methods-vars" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.8' EnforcedStyle: snake_case @@ -2293,19 +2351,19 @@ Security/CompoundHash: VersionChanged: '1.51' Security/Eval: Description: The use of eval represents a serious security risk. - Enabled: true + Enabled: false VersionAdded: '0.47' Security/IoMethods: Description: Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`, `IO.foreach`, and `IO.readlines`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.22' Security/JSONLoad: Description: Prefer usage of `JSON.parse` over `JSON.load` due to potential security issues. See reference for more information. Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load - Enabled: true + Enabled: false VersionAdded: '0.43' VersionChanged: '1.22' SafeAutoCorrect: false @@ -2318,7 +2376,7 @@ Security/MarshalLoad: Security/Open: Description: The use of `Kernel#open` and `URI.open` represent a serious security risk. - Enabled: true + Enabled: false VersionAdded: '0.53' VersionChanged: '1.0' Safe: false @@ -2333,12 +2391,14 @@ Style/AccessModifierDeclarations: Description: Checks style of how access modifiers are used. Enabled: false VersionAdded: '0.57' - VersionChanged: '0.81' + VersionChanged: '1.70' EnforcedStyle: group SupportedStyles: - inline - group AllowModifiersOnSymbols: true + AllowModifiersOnAttrs: true + AllowModifiersOnAliasMethod: true SafeAutoCorrect: false Style/AccessorGrouping: Description: Checks for grouping of accessors in `class` and `module` bodies. @@ -2351,17 +2411,22 @@ Style/AccessorGrouping: Style/Alias: Description: Use alias instead of alias_method. StyleGuide: "#alias-method-lexically" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.36' EnforcedStyle: prefer_alias_method SupportedStyles: - prefer_alias - prefer_alias_method +Style/AmbiguousEndlessMethodDefinition: + Description: Checks for endless methods inside operators of lower precedence. + StyleGuide: "#ambiguous-endless-method-defintions" + Enabled: false + VersionAdded: '1.68' Style/AndOr: Description: Use &&/|| instead of and/or. StyleGuide: "#no-and-or-or" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.9' VersionChanged: '1.21' @@ -2404,13 +2469,13 @@ Style/ArrayFirstLast: Safe: false Style/ArrayIntersect: Description: Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.40' Style/ArrayJoin: Description: Use Array#join instead of Array#*. StyleGuide: "#array-join" - Enabled: true + Enabled: false VersionAdded: '0.20' VersionChanged: '0.31' Style/AsciiComments: @@ -2424,7 +2489,7 @@ Style/AsciiComments: Style/Attr: Description: Checks for uses of Module#attr. StyleGuide: "#attr" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' Style/AutoResourceCleanup: @@ -2435,7 +2500,7 @@ Style/AutoResourceCleanup: Style/BarePercentLiterals: Description: Checks if usage of %() or %Q() matches configuration. StyleGuide: "#percent-q-shorthand" - Enabled: true + Enabled: false VersionAdded: '0.25' EnforcedStyle: bare_percent SupportedStyles: @@ -2444,24 +2509,30 @@ Style/BarePercentLiterals: Style/BeginBlock: Description: Avoid the use of BEGIN blocks. StyleGuide: "#no-BEGIN-blocks" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/BisectedAttrAccessor: Description: Checks for places where `attr_reader` and `attr_writer` for the same method can be combined into single `attr_accessor`. Enabled: false VersionAdded: '0.87' +Style/BitwisePredicate: + Description: Prefer bitwise predicate methods over direct comparison operations. + StyleGuide: "#bitwise-predicate-methods" + Enabled: false + Safe: false + VersionAdded: '1.68' Style/BlockComments: Description: Do not use block comments. StyleGuide: "#no-block-comments" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.23' Style/BlockDelimiters: Description: Avoid using {...} for multi-line blocks (multiline chaining is always ugly). Prefer {...} over do...end for single-line blocks. StyleGuide: "#single-line-blocks" - Enabled: true + Enabled: false VersionAdded: '0.30' VersionChanged: '0.35' EnforcedStyle: line_count_based @@ -2496,7 +2567,7 @@ Style/BlockDelimiters: Style/CaseEquality: Description: Avoid explicit use of the case equality operator(===). StyleGuide: "#no-case-equality" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.89' AllowOnConstant: true @@ -2513,13 +2584,13 @@ Style/CaseLikeIf: Style/CharacterLiteral: Description: Checks for uses of character literals. StyleGuide: "#no-character-literals" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/ClassAndModuleChildren: Description: Checks style of children classes and modules. StyleGuide: "#namespace-definition" SafeAutoCorrect: false - Enabled: true + Enabled: false VersionAdded: '0.19' EnforcedStyle: nested SupportedStyles: @@ -2528,7 +2599,7 @@ Style/ClassAndModuleChildren: Style/ClassCheck: Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`. StyleGuide: "#is-a-vs-kind-of" - Enabled: true + Enabled: false VersionAdded: '0.24' EnforcedStyle: is_a? SupportedStyles: @@ -2550,14 +2621,14 @@ Style/ClassEqualityComparison: Style/ClassMethods: Description: Use self when defining module/class methods. StyleGuide: "#def-self-class-methods" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.20' Style/ClassMethodsDefinitions: Description: Enforces using `def self.method_name` or `class << self` to define class methods. StyleGuide: "#def-self-class-methods" - Enabled: true + Enabled: false VersionAdded: '0.89' EnforcedStyle: self_class SupportedStyles: @@ -2566,7 +2637,7 @@ Style/ClassMethodsDefinitions: Style/ClassVars: Description: Avoid the use of class variables. StyleGuide: "#no-class-vars" - Enabled: true + Enabled: false VersionAdded: '0.13' Style/CollectionCompact: Description: Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject @@ -2597,13 +2668,18 @@ Style/CollectionMethods: Style/ColonMethodCall: Description: 'Do not use :: for method call.' StyleGuide: "#double-colons" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/ColonMethodDefinition: Description: 'Do not use :: for defining class methods.' StyleGuide: "#colon-method-definition" Enabled: false VersionAdded: '0.52' +Style/CombinableDefined: + Description: Checks successive `defined?` calls that can be combined into a single + call. + Enabled: false + VersionAdded: '1.68' Style/CombinableLoops: Description: Checks for places where multiple consecutive loops over the same data can be combined into a single loop. @@ -2613,7 +2689,7 @@ Style/CombinableLoops: Style/CommandLiteral: Description: Use `` or %x around command literals. StyleGuide: "#percent-x" - Enabled: true + Enabled: false VersionAdded: '0.30' EnforcedStyle: percent_x SupportedStyles: @@ -2625,7 +2701,7 @@ Style/CommentAnnotation: Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE). StyleGuide: "#annotate-keywords" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '1.20' Keywords: @@ -2645,19 +2721,19 @@ Style/CommentedKeyword: Style/ComparableClamp: Description: Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum. - Enabled: true + Enabled: false VersionAdded: '1.44' Style/ConcatArrayLiterals: Description: Enforces the use of `Array#push(item)` instead of `Array#concat([item])` to avoid redundant array literals. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.41' Style/ConditionalAssignment: Description: Use the return value of `if` and `case` statements for assignment to a variable and variable comparison instead of assigning that variable inside of each branch. - Enabled: true + Enabled: false VersionAdded: '0.36' VersionChanged: '0.47' EnforcedStyle: assign_to_condition @@ -2681,14 +2757,14 @@ Style/Copyright: Style/DataInheritance: Description: Checks for inheritance from Data.define. StyleGuide: "#no-extend-data-define" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '1.49' VersionChanged: '1.51' Style/DateTime: Description: Use Time over DateTime. StyleGuide: "#date-time" - Enabled: true + Enabled: false VersionAdded: '0.51' VersionChanged: '0.92' SafeAutoCorrect: false @@ -2696,9 +2772,14 @@ Style/DateTime: Style/DefWithParentheses: Description: Use def with parentheses when there are arguments. StyleGuide: "#method-parens" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' +Style/DigChain: + Description: Use `dig` with multiple parameters instead of chaining multiple calls. + Enabled: false + Safe: false + VersionAdded: '1.69' Style/Dir: Description: Use the `__dir__` method to retrieve the canonicalized absolute path to the current file. @@ -2707,7 +2788,7 @@ Style/Dir: Style/DirEmpty: Description: Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty. - Enabled: true + Enabled: false VersionAdded: '1.48' Style/DisableCopsWithinSourceCodeDirective: Description: Forbids disabling/enabling cops within source code. @@ -2734,6 +2815,7 @@ Style/DocumentationMethod: Description: Checks for missing documentation comment for public methods. Enabled: false VersionAdded: '0.43' + AllowedMethods: [] Exclude: - "/spec/**/*" - "/test/**/*" @@ -2756,11 +2838,11 @@ Style/DoubleNegation: Style/EachForSimpleLoop: Description: Use `Integer#times` for a simple loop which iterates a fixed number of times. - Enabled: true + Enabled: false VersionAdded: '0.41' Style/EachWithObject: Description: Prefer `each_with_object` over `inject` or `reduce`. - Enabled: true + Enabled: false VersionAdded: '0.22' VersionChanged: '0.42' Style/EmptyBlockParameter: @@ -2769,11 +2851,11 @@ Style/EmptyBlockParameter: VersionAdded: '0.52' Style/EmptyCaseCondition: Description: Avoid empty condition in case statements. - Enabled: true + Enabled: false VersionAdded: '0.40' Style/EmptyElse: Description: Avoid empty else-clauses. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '0.28' VersionChanged: '1.61' @@ -2785,7 +2867,7 @@ Style/EmptyElse: AllowComments: true Style/EmptyHeredoc: Description: Checks for using empty heredoc to reduce redundancy. - Enabled: true + Enabled: false AutoCorrect: contextual VersionAdded: '1.32' VersionChanged: '1.61' @@ -2796,7 +2878,7 @@ Style/EmptyLambdaParameter: Style/EmptyLiteral: Description: Prefer literals to Array.new/Hash.new/String.new. StyleGuide: "#literal-array-hash" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.12' Style/EmptyMethod: @@ -2819,13 +2901,13 @@ Style/Encoding: Style/EndBlock: Description: Avoid the use of END blocks. StyleGuide: "#no-END-blocks" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.81' Style/EndlessMethod: Description: Avoid the use of multi-lined endless method definitions. StyleGuide: "#endless-methods" - Enabled: true + Enabled: false VersionAdded: '1.8' EnforcedStyle: allow_single_line SupportedStyles: @@ -2845,12 +2927,12 @@ Style/EvalWithLocation: Style/EvenOdd: Description: Favor the use of `Integer#even?` && `Integer#odd?`. StyleGuide: "#predicate-methods" - Enabled: true + Enabled: false VersionAdded: '0.12' VersionChanged: '0.29' Style/ExactRegexpMatch: Description: Checks for exact regexp match inside Regexp literals. - Enabled: true + Enabled: false VersionAdded: '1.51' Style/ExpandPathArguments: Description: Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`. @@ -2860,7 +2942,7 @@ Style/ExplicitBlockArgument: Description: Consider using explicit block argument to avoid writing block literal that just passes its arguments to another block. StyleGuide: "#block-argument" - Enabled: true + Enabled: false VersionAdded: '0.89' VersionChanged: '1.8' Style/ExponentialNotation: @@ -2884,14 +2966,24 @@ Style/FetchEnvVar: Style/FileEmpty: Description: Prefer to use `File.empty?('path/to/file')` when checking if a file is empty. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.48' +Style/FileNull: + Description: Use `File::NULL` instead of hardcoding "dev/null". + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.69' Style/FileRead: Description: Favor `File.(bin)read` convenience methods. StyleGuide: "#file-read" Enabled: false VersionAdded: '1.24' +Style/FileTouch: + Description: Favor `FileUtils.touch` for touching files. + Enabled: false + VersionAdded: '1.69' + SafeAutoCorrect: false Style/FileWrite: Description: Favor `File.(bin)write` convenience methods. StyleGuide: "#file-write" @@ -2914,7 +3006,7 @@ Style/FloatDivision: Style/For: Description: Checks use of for or each in multiline loops. StyleGuide: "#no-for-loops" - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.13' VersionChanged: '1.26' @@ -2925,7 +3017,7 @@ Style/For: Style/FormatString: Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%. StyleGuide: "#sprintf" - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.49' EnforcedStyle: format @@ -2958,20 +3050,22 @@ Style/FrozenStringLiteralComment: - always_true - never SafeAutoCorrect: true + Exclude: + - "/**/*.arb" 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/GlobalStdStream: Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`. StyleGuide: "#global-stdout" - Enabled: true + Enabled: false VersionAdded: '0.89' SafeAutoCorrect: false Style/GlobalVars: Description: Do not introduce global variables. StyleGuide: "#instance-vars" Reference: https://www.zenspider.com/ruby/quickref.html - Enabled: true + Enabled: false VersionAdded: '0.13' AllowedVariables: [] Style/GuardClause: @@ -3022,13 +3116,19 @@ Style/HashLikeCase: Enabled: false VersionAdded: '0.88' MinBranchesCount: 3 +Style/HashSlice: + Description: Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` + methods that can be replaced with `Hash#slice` method. + Enabled: false + Safe: false + VersionAdded: '1.71' Style/HashSyntax: Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.' StyleGuide: "#hash-literals" - Enabled: true + Enabled: false VersionAdded: '0.9' - VersionChanged: '1.24' + VersionChanged: '1.67' EnforcedStyle: ruby19 SupportedStyles: - ruby19 @@ -3041,6 +3141,7 @@ Style/HashSyntax: - never - either - consistent + - either_consistent UseHashRocketsWithSymbolValues: false PreferHashRocketsForNonAlnumEndingSymbols: false Style/HashTransformKeys: @@ -3058,13 +3159,13 @@ Style/HashTransformValues: Style/IdenticalConditionalBranches: Description: Checks that conditional statements do not have an identical line at the end of each branch, which can validly be moved out of the conditional. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.36' VersionChanged: '1.19' Style/IfInsideElse: Description: Finds if nodes inside else, which can be converted to elsif. - Enabled: true + Enabled: false AllowIfModifier: false VersionAdded: '0.36' VersionChanged: '1.3' @@ -3076,12 +3177,12 @@ Style/IfUnlessModifier: VersionChanged: '0.30' Style/IfUnlessModifierOfIfUnless: Description: Avoid modifier if/unless usage on conditionals. - Enabled: true + Enabled: false VersionAdded: '0.39' VersionChanged: '0.87' Style/IfWithBooleanLiteralBranches: Description: Checks for redundant `if` with boolean literal branches. - Enabled: true + Enabled: false VersionAdded: '1.9' SafeAutoCorrect: false AllowedMethods: @@ -3089,7 +3190,7 @@ Style/IfWithBooleanLiteralBranches: Style/IfWithSemicolon: Description: Do not use if x; .... Use the ternary operator instead. StyleGuide: "#no-semicolon-ifs" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.83' Style/ImplicitRuntimeError: @@ -3100,14 +3201,14 @@ Style/ImplicitRuntimeError: Style/InPatternThen: Description: Checks for `in;` uses in `case` expressions. StyleGuide: "#no-in-pattern-semicolons" - Enabled: true + Enabled: false VersionAdded: '1.16' Style/InfiniteLoop: Description: Use Kernel#loop for infinite loops. This cop is unsafe if the body may raise a `StopIteration` exception. Safe: false StyleGuide: "#infinite-loop" - Enabled: true + Enabled: false VersionAdded: '0.26' VersionChanged: '0.61' Style/InlineComment: @@ -3132,7 +3233,7 @@ Style/InverseMethods: :select!: :reject! Style/InvertibleUnlessCondition: Description: Favor `if` with inverted condition over `unless`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.44' VersionChanged: '1.50' @@ -3161,6 +3262,16 @@ Style/IpAddresses: - "/**/Gemfile" - "/**/gems.rb" - "/**/*.gemspec" +Style/ItAssignment: + Description: Checks for assignment to `it` inside a block. + Enabled: false + VersionAdded: '1.70' +Style/KeywordArgumentsMerging: + Description: When passing an existing hash as keyword arguments, provide additional + arguments directly rather than using `merge`. + StyleGuide: "#merging-keyword-arguments" + Enabled: false + VersionAdded: '1.68' Style/KeywordParametersOrder: Description: Enforces that optional keyword parameters are placed at the end of the parameters list. @@ -3182,7 +3293,7 @@ Style/Lambda: Style/LambdaCall: Description: Use lambda.call(...) instead of lambda.(...). StyleGuide: "#proc-call" - Enabled: true + Enabled: false VersionAdded: '0.13' VersionChanged: '0.14' EnforcedStyle: call @@ -3192,13 +3303,13 @@ Style/LambdaCall: Style/LineEndConcatenation: Description: Use \ instead of + or << to concatenate two string literals at line end. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.18' VersionChanged: '0.64' Style/MagicCommentFormat: Description: Use a consistent style for magic comments. - Enabled: true + Enabled: false VersionAdded: '1.35' EnforcedStyle: snake_case SupportedStyles: @@ -3219,6 +3330,7 @@ Style/MapIntoArray: StyleGuide: "#functional-code" Enabled: false VersionAdded: '1.63' + VersionChanged: '1.67' Safe: false Style/MapToHash: Description: Prefer `to_h` with a block over `map.to_h`. @@ -3233,7 +3345,7 @@ Style/MapToSet: Style/MethodCallWithArgsParentheses: Description: Use parentheses for method calls with arguments. StyleGuide: "#method-invocation-parens" - Enabled: true + Enabled: false VersionAdded: '0.47' VersionChanged: '1.7' IgnoreMacros: true @@ -3259,7 +3371,7 @@ Style/MethodCallWithArgsParentheses: Style/MethodCallWithoutArgsParentheses: Description: Do not use parentheses for method calls with no arguments. StyleGuide: "#method-invocation-parens" - Enabled: true + Enabled: false AllowedMethods: [] AllowedPatterns: [] VersionAdded: '0.47' @@ -3272,7 +3384,7 @@ Style/MethodCalledOnDoEndBlock: Style/MethodDefParentheses: Description: Checks if the method definitions have or don't have parentheses. StyleGuide: "#method-parens" - Enabled: true + Enabled: false VersionAdded: '0.16' VersionChanged: '1.7' EnforcedStyle: require_parentheses @@ -3288,7 +3400,7 @@ Style/MinMax: Style/MinMaxComparison: Description: Enforces the use of `max` or `min` instead of comparison for greater or less. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.42' Style/MissingElse: @@ -3306,7 +3418,7 @@ Style/MissingElse: Style/MissingRespondToMissing: Description: Checks if `method_missing` is implemented without implementing `respond_to_missing`. StyleGuide: "#no-method-missing" - Enabled: true + Enabled: false VersionAdded: '0.56' Style/MixinGrouping: Description: Checks for grouping of mixins in `class` and `module` bodies. @@ -3320,12 +3432,12 @@ Style/MixinGrouping: - grouped Style/MixinUsage: Description: Checks that `include`, `extend` and `prepend` exists at the top level. - Enabled: true + Enabled: false VersionAdded: '0.51' Style/ModuleFunction: Description: Checks for usage of `extend self` in modules. StyleGuide: "#module-function" - Enabled: true + Enabled: false VersionAdded: '0.11' VersionChanged: '0.65' EnforcedStyle: extend_self @@ -3348,7 +3460,7 @@ Style/MultilineIfModifier: Style/MultilineIfThen: Description: Do not use then for multi-line if/unless. StyleGuide: "#no-then" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.26' Style/MultilineInPatternThen: @@ -3358,7 +3470,7 @@ Style/MultilineInPatternThen: VersionAdded: '1.16' Style/MultilineMemoization: Description: Wrap multiline memoizations in a `begin` and `end` block. - Enabled: true + Enabled: false VersionAdded: '0.44' VersionChanged: '0.48' EnforcedStyle: keyword @@ -3373,7 +3485,7 @@ Style/MultilineMethodSignature: Style/MultilineTernaryOperator: Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.' StyleGuide: "#no-multiline-ternary" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.86' Style/MultilineWhenThen: @@ -3402,7 +3514,7 @@ Style/MutableConstant: Style/NegatedIf: Description: Favor unless over if for negative conditions (or control flow or). StyleGuide: "#unless-for-negatives" - Enabled: true + Enabled: false VersionAdded: '0.20' VersionChanged: '0.48' EnforcedStyle: both @@ -3428,21 +3540,21 @@ Style/NegatedUnless: Style/NegatedWhile: Description: Favor until over while for negative conditions. StyleGuide: "#until-for-negatives" - Enabled: true + Enabled: false VersionAdded: '0.20' Style/NestedFileDirname: Description: Checks for nested `File.dirname`. - Enabled: true + Enabled: false VersionAdded: '1.26' Style/NestedModifier: Description: Avoid using nested modifiers. StyleGuide: "#no-nested-modifiers" - Enabled: true + Enabled: false VersionAdded: '0.35' Style/NestedParenthesizedCalls: Description: Parenthesize method calls which are nested inside the argument list of another parenthesized method call. - Enabled: true + Enabled: false VersionAdded: '0.36' VersionChanged: '0.77' AllowedMethods: @@ -3466,13 +3578,13 @@ Style/NestedParenthesizedCalls: Style/NestedTernaryOperator: Description: Use one expression per branch in a ternary operator. StyleGuide: "#no-nested-ternary" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.86' Style/Next: Description: Use `next` to skip iteration instead of a condition at the end. StyleGuide: "#no-nested-conditionals" - Enabled: true + Enabled: false VersionAdded: '0.22' VersionChanged: '0.35' EnforcedStyle: skip_modifier_ifs @@ -3483,7 +3595,7 @@ Style/Next: Style/NilComparison: Description: Prefer x.nil? to x == nil. StyleGuide: "#predicate-methods" - Enabled: true + Enabled: false VersionAdded: '0.12' VersionChanged: '0.59' EnforcedStyle: predicate @@ -3498,14 +3610,14 @@ Style/NilLambda: Style/NonNilCheck: Description: Checks for redundant nil checks. StyleGuide: "#no-non-nil-checks" - Enabled: true + Enabled: false VersionAdded: '0.20' VersionChanged: '0.22' IncludeSemanticChanges: false Style/Not: Description: Use ! instead of not. StyleGuide: "#bang-not-not" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.20' Style/NumberedParameters: @@ -3524,7 +3636,7 @@ Style/NumberedParametersLimit: Style/NumericLiteralPrefix: Description: Use smallcase prefixes for numeric literals. StyleGuide: "#numeric-literal-prefixes" - Enabled: true + Enabled: false VersionAdded: '0.41' EnforcedOctalStyle: zero_with_o SupportedOctalStyles: @@ -3570,7 +3682,7 @@ Style/OneLineConditional: Description: Favor the ternary operator (?:) or multi-line constructs over single-line if/then/else/end constructs. StyleGuide: "#ternary-operator" - Enabled: true + Enabled: false AlwaysCorrectToMultiline: false VersionAdded: '0.9' VersionChanged: '0.90' @@ -3579,14 +3691,14 @@ Style/OpenStructUse: due to performance, version compatibility, and potential security issues. Reference: - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats - Enabled: true + Enabled: false Safe: false VersionAdded: '1.23' VersionChanged: '1.51' Style/OperatorMethodCall: Description: Checks for redundant dot before operator method call. StyleGuide: "#operator-method-call" - Enabled: true + Enabled: false VersionAdded: '1.37' Style/OptionHash: Description: Don't use option hashes when you can use keyword arguments. @@ -3605,7 +3717,7 @@ Style/OptionalArguments: Description: Checks for optional arguments that do not appear at the end of the argument list. StyleGuide: "#optional-arguments" - Enabled: true + Enabled: false Safe: false VersionAdded: '0.33' VersionChanged: '0.83' @@ -3626,12 +3738,12 @@ Style/ParallelAssignment: Description: Check for simple usages of parallel assignment. It will only warn when the number of variables matches on both sides of the assignment. StyleGuide: "#parallel-assignment" - Enabled: true + Enabled: false VersionAdded: '0.32' Style/ParenthesesAroundCondition: Description: Don't use parentheses around the condition of an if/unless/while. StyleGuide: "#no-parens-around-condition" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.56' AllowSafeAssignment: true @@ -3651,7 +3763,7 @@ Style/PercentLiteralDelimiters: VersionChanged: '0.48' Style/PercentQLiterals: Description: Checks if uses of %Q/%q match the configured preference. - Enabled: true + Enabled: false VersionAdded: '0.25' EnforcedStyle: lower_case_q SupportedStyles: @@ -3660,12 +3772,12 @@ Style/PercentQLiterals: Style/PerlBackrefs: Description: Avoid Perl-style regex back references. StyleGuide: "#no-perl-regexp-last-matchers" - Enabled: true + Enabled: false VersionAdded: '0.13' Style/PreferredHashMethods: Description: Checks use of `has_key?` and `has_value?` Hash methods. StyleGuide: "#hash-key" - Enabled: true + Enabled: false Safe: false VersionAdded: '0.41' VersionChanged: '0.70' @@ -3676,12 +3788,12 @@ Style/PreferredHashMethods: Style/Proc: Description: Use proc instead of Proc.new. StyleGuide: "#proc" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.18' Style/QuotedSymbols: Description: Use a consistent style for quoted symbols. - Enabled: true + Enabled: false VersionAdded: '1.16' EnforcedStyle: same_as_string_literals SupportedStyles: @@ -3691,7 +3803,7 @@ Style/QuotedSymbols: Style/RaiseArgs: Description: Checks the arguments passed to raise/fail. StyleGuide: "#exception-class-messages" - Enabled: true + Enabled: false Safe: false VersionAdded: '0.14' VersionChanged: '1.61' @@ -3722,7 +3834,7 @@ Style/RedundantArgument: chomp!: "\n" Style/RedundantArrayConstructor: Description: Checks for the instantiation of array using redundant `Array` constructor. - Enabled: true + Enabled: false VersionAdded: '1.52' Style/RedundantAssignment: Description: Checks for redundant assignment before returning. @@ -3731,12 +3843,12 @@ Style/RedundantAssignment: Style/RedundantBegin: Description: Don't use begin blocks when they are not needed. StyleGuide: "#begin-implicit" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '0.21' Style/RedundantCapitalW: Description: Checks for %W when interpolation is not needed. - Enabled: true + Enabled: false VersionAdded: '0.76' Style/RedundantCondition: Description: Checks for unnecessary conditional expressions. @@ -3748,25 +3860,25 @@ Style/RedundantConditional: VersionAdded: '0.50' Style/RedundantConstantBase: Description: Avoid redundant `::` prefix on constant. - Enabled: true + Enabled: false VersionAdded: '1.40' Style/RedundantCurrentDirectoryInPath: - Description: Checks for uses a redundant current directory in path. - Enabled: true + Description: Checks for a redundant current directory in a path given to `require_relative`. + Enabled: false VersionAdded: '1.53' Style/RedundantDoubleSplatHashBraces: Description: Checks for redundant uses of double splat hash braces. - Enabled: true + Enabled: false VersionAdded: '1.41' Style/RedundantEach: Description: Checks for redundant `each`. - Enabled: true + Enabled: false Safe: false VersionAdded: '1.38' Style/RedundantException: Description: Checks for an obsolete RuntimeException argument in raise/fail. StyleGuide: "#no-explicit-runtimeerror" - Enabled: true + Enabled: false VersionAdded: '0.14' VersionChanged: '0.29' Style/RedundantFetchBlock: @@ -3788,18 +3900,18 @@ Style/RedundantFilterChain: Description: Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods chained to `select`/`filter`/`find_all` and change them to use predicate method instead. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '1.52' VersionChanged: '1.57' Style/RedundantFreeze: Description: Checks usages of Object#freeze on immutable objects. - Enabled: true + Enabled: false VersionAdded: '0.34' VersionChanged: '0.66' Style/RedundantHeredocDelimiterQuotes: Description: Checks for redundant heredoc delimiter quotes. - Enabled: true + Enabled: false VersionAdded: '1.45' Style/RedundantInitialize: Description: Checks for redundant `initialize` methods. @@ -3811,27 +3923,31 @@ Style/RedundantInitialize: VersionChanged: '1.61' Style/RedundantInterpolation: Description: Checks for strings that are just an interpolated expression. - Enabled: true + Enabled: false SafeAutoCorrect: false VersionAdded: '0.76' VersionChanged: '1.30' +Style/RedundantInterpolationUnfreeze: + Description: Checks for redundant unfreezing of interpolated strings. + Enabled: false + VersionAdded: '1.66' Style/RedundantLineContinuation: Description: Check for redundant line continuation. - Enabled: true + Enabled: false VersionAdded: '1.49' Style/RedundantParentheses: Description: Checks for parentheses that seem not to serve any purpose. - Enabled: true + Enabled: false VersionAdded: '0.36' Style/RedundantPercentQ: Description: Checks for %q/%Q when single quotes or double quotes would do. StyleGuide: "#percent-q" - Enabled: true + Enabled: false VersionAdded: '0.76' Style/RedundantRegexpArgument: Description: Identifies places where argument can be replaced from a deterministic regexp to a string. - Enabled: true + Enabled: false VersionAdded: '1.53' Style/RedundantRegexpCharacterClass: Description: Checks for unnecessary single-element Regexp character classes. @@ -3840,7 +3956,7 @@ Style/RedundantRegexpCharacterClass: Style/RedundantRegexpConstructor: Description: Checks for the instantiation of regexp using redundant `Regexp.new` or `Regexp.compile`. - Enabled: true + Enabled: false VersionAdded: '1.52' Style/RedundantRegexpEscape: Description: Checks for redundant escapes in Regexps. @@ -3849,14 +3965,14 @@ Style/RedundantRegexpEscape: Style/RedundantReturn: Description: Don't use return where it's not required. StyleGuide: "#no-explicit-return" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '0.14' AllowMultipleReturnValues: false Style/RedundantSelf: Description: Don't use self where it's not needed. StyleGuide: "#no-self-unless-required" - Enabled: true + Enabled: false VersionAdded: '0.10' VersionChanged: '0.13' Style/RedundantSelfAssignment: @@ -3878,16 +3994,16 @@ Style/RedundantSort: Safe: false Style/RedundantSortBy: Description: Use `sort` instead of `sort_by { |x| x }`. - Enabled: true + Enabled: false VersionAdded: '0.36' Style/RedundantStringEscape: Description: Checks for redundant escapes in string literals. - Enabled: true + Enabled: false VersionAdded: '1.37' Style/RegexpLiteral: Description: Use / or %r around regular expressions. StyleGuide: "#percent-r" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.30' EnforcedStyle: mixed @@ -3904,7 +4020,7 @@ Style/RequireOrder: Style/RescueModifier: Description: Avoid using rescue in its modifier form. StyleGuide: "#no-rescue-modifiers" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.34' Style/RescueStandardError: @@ -3917,7 +4033,7 @@ Style/RescueStandardError: - explicit Style/ReturnNil: Description: Use return instead of return nil. - Enabled: true + Enabled: false EnforcedStyle: return SupportedStyles: - return @@ -3926,18 +4042,19 @@ Style/ReturnNil: Style/ReturnNilInPredicateMethodDefinition: Description: Checks if uses of `return` or `return nil` in predicate method definition. StyleGuide: "#bool-methods-qmark" - Enabled: true + Enabled: false SafeAutoCorrect: false AllowedMethods: [] AllowedPatterns: [] VersionAdded: '1.53' + VersionChanged: '1.67' Style/SafeNavigation: Description: Transforms usages of a method call safeguarded by a check for the existence of the object to safe navigation (`&.`). Autocorrection is unsafe as it assumes the object will be `nil` or truthy, but never `false`. - Enabled: true + Enabled: false VersionAdded: '0.43' - VersionChanged: '1.27' + VersionChanged: '1.67' ConvertCodeThatCanStartToReturnNil: false AllowedMethods: - present? @@ -3947,10 +4064,17 @@ Style/SafeNavigation: - try! SafeAutoCorrect: false MaxChainLength: 2 +Style/SafeNavigationChainLength: + Description: Enforces safe navigation chains length to not exceed the configured + maximum. + StyleGuide: "#safe-navigation" + Enabled: false + VersionAdded: '1.68' + Max: 2 Style/Sample: Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`. Reference: https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code - Enabled: true + Enabled: false VersionAdded: '0.30' Style/SelectByRegexp: Description: Prefer grep/grep_v to select/reject with a regexp match. @@ -3961,13 +4085,13 @@ Style/SelfAssignment: Description: Checks for places where self-assignment shorthand should have been used. StyleGuide: "#self-assignment" - Enabled: true + Enabled: false VersionAdded: '0.19' VersionChanged: '0.29' Style/Semicolon: Description: Don't use semicolons to terminate expressions. StyleGuide: "#no-semicolon" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.19' AllowAsExpressionSeparator: false @@ -3977,10 +4101,17 @@ Style/Send: StyleGuide: "#prefer-public-send" Enabled: false VersionAdded: '0.33' +Style/SendWithLiteralMethodName: + Description: Detects the use of the `public_send` method with a static method name + argument. + Enabled: false + Safe: false + AllowSend: true + VersionAdded: '1.64' Style/SignalException: Description: Checks for proper usage of fail and raise. StyleGuide: "#prefer-raise-over-fail" - Enabled: true + Enabled: false VersionAdded: '0.11' VersionChanged: '0.37' EnforcedStyle: only_raise @@ -4008,12 +4139,12 @@ Style/SingleLineBlockParams: Style/SingleLineDoEndBlock: Description: Checks for single-line `do`...`end` blocks. StyleGuide: "#single-line-do-end-block" - Enabled: true + Enabled: false VersionAdded: '1.57' Style/SingleLineMethods: Description: Avoid single-line methods. StyleGuide: "#no-single-line-methods" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.8' AllowIfMethodIsEmpty: true @@ -4034,7 +4165,7 @@ Style/SoleNestedConditional: Style/SpecialGlobalVars: Description: Avoid Perl-style global variables. StyleGuide: "#no-cryptic-perlisms" - Enabled: true + Enabled: false VersionAdded: '0.13' VersionChanged: '0.36' SafeAutoCorrect: false @@ -4047,7 +4178,7 @@ Style/SpecialGlobalVars: Style/StabbyLambdaParentheses: Description: Check for the usage of parentheses around stabby lambda arguments. StyleGuide: "#stabby-lambda-with-args" - Enabled: true + Enabled: false VersionAdded: '0.35' EnforcedStyle: require_parentheses SupportedStyles: @@ -4090,7 +4221,7 @@ Style/StringHashKeys: Style/StringLiterals: Description: Checks if uses of quotes match the configured preference. StyleGuide: "#consistent-string-literals" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.36' EnforcedStyle: double_quotes @@ -4101,7 +4232,7 @@ Style/StringLiterals: Style/StringLiteralsInInterpolation: Description: Checks if uses of quotes inside expressions in interpolated strings match the configured preference. - Enabled: true + Enabled: false VersionAdded: '0.27' EnforcedStyle: double_quotes SupportedStyles: @@ -4116,7 +4247,7 @@ Style/StringMethods: intern: to_sym Style/Strip: Description: Use `strip` instead of `lstrip.rstrip`. - Enabled: true + Enabled: false VersionAdded: '0.36' Style/StructInheritance: Description: Checks for inheritance from Struct.new. @@ -4125,10 +4256,15 @@ Style/StructInheritance: SafeAutoCorrect: false VersionAdded: '0.29' VersionChanged: '1.20' +Style/SuperArguments: + Description: Call `super` without arguments and parentheses when the signature is + identical. + Enabled: false + VersionAdded: '1.64' Style/SuperWithArgsParentheses: Description: Use parentheses for `super` with arguments. StyleGuide: "#super-with-args" - Enabled: true + Enabled: false VersionAdded: '1.58' Style/SwapValues: Description: Enforces the use of shorthand-style swapping of 2 variables. @@ -4139,7 +4275,7 @@ Style/SwapValues: Style/SymbolArray: Description: Use %i or %I for arrays of symbols. StyleGuide: "#percent-i" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.49' EnforcedStyle: brackets @@ -4149,14 +4285,14 @@ Style/SymbolArray: - brackets Style/SymbolLiteral: Description: Use plain symbols instead of string symbols when possible. - Enabled: true + Enabled: false VersionAdded: '0.30' Style/SymbolProc: Description: Use symbols as procs instead of blocks when possible. - Enabled: true + Enabled: false Safe: false VersionAdded: '0.26' - VersionChanged: '1.40' + VersionChanged: '1.64' AllowMethodsWithArguments: false AllowedMethods: - define_method @@ -4164,7 +4300,7 @@ Style/SymbolProc: AllowComments: false Style/TernaryParentheses: Description: Checks for use of parentheses around ternary conditions. - Enabled: true + Enabled: false VersionAdded: '0.42' VersionChanged: '0.46' EnforcedStyle: require_no_parentheses @@ -4180,7 +4316,7 @@ Style/TopLevelMethodDefinition: VersionAdded: '1.15' Style/TrailingBodyOnClass: Description: Class body goes below class statement. - Enabled: true + Enabled: false VersionAdded: '0.53' Style/TrailingBodyOnMethodDefinition: Description: Method body goes below definition. @@ -4188,12 +4324,12 @@ Style/TrailingBodyOnMethodDefinition: VersionAdded: '0.52' Style/TrailingBodyOnModule: Description: Module body goes below module statement. - Enabled: true + Enabled: false VersionAdded: '0.53' Style/TrailingCommaInArguments: Description: Checks for trailing comma in argument lists. StyleGuide: "#no-trailing-params-comma" - Enabled: true + Enabled: false VersionAdded: '0.36' EnforcedStyleForMultiline: comma SupportedStylesForMultiline: @@ -4203,7 +4339,7 @@ Style/TrailingCommaInArguments: Style/TrailingCommaInArrayLiteral: Description: Checks for trailing comma in array literals. StyleGuide: "#no-trailing-array-commas" - Enabled: true + Enabled: false VersionAdded: '0.53' EnforcedStyleForMultiline: consistent_comma SupportedStylesForMultiline: @@ -4217,7 +4353,7 @@ Style/TrailingCommaInBlockArgs: VersionAdded: '0.81' Style/TrailingCommaInHashLiteral: Description: Checks for trailing comma in hash literals. - Enabled: true + Enabled: false EnforcedStyleForMultiline: consistent_comma SupportedStylesForMultiline: - comma @@ -4238,7 +4374,7 @@ Style/TrailingUnderscoreVariable: Style/TrivialAccessors: Description: Prefer attr_* methods to trivial readers/writers. StyleGuide: "#attr_family" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.15' ExactNameMatch: true @@ -4266,7 +4402,7 @@ Style/TrivialAccessors: Style/UnlessElse: Description: Do not use unless with else. Rewrite these with the positive case first. StyleGuide: "#no-else-with-unless" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/UnlessLogicalOperators: Description: Checks for use of logical operators in an unless condition. @@ -4285,29 +4421,29 @@ Style/VariableInterpolation: Description: Don't interpolate global, instance and class variables directly in strings. StyleGuide: "#curlies-interpolate" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.20' Style/WhenThen: Description: Use when x then ... for one-line cases. StyleGuide: "#no-when-semicolons" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/WhileUntilDo: Description: Checks for redundant do after while or until. StyleGuide: "#no-multiline-while-do" - Enabled: true + Enabled: false VersionAdded: '0.9' Style/WhileUntilModifier: Description: Favor modifier while/until usage when you have a single-line body. StyleGuide: "#while-as-a-modifier" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '0.30' Style/WordArray: Description: Use %w or %W for arrays of words. StyleGuide: "#percent-w" - Enabled: true + Enabled: false VersionAdded: '0.9' VersionChanged: '1.19' EnforcedStyle: brackets @@ -4319,7 +4455,7 @@ Style/WordArray: Style/YAMLFileRead: Description: Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` with `File.read` argument. - Enabled: true + Enabled: false VersionAdded: '1.53' Style/YodaCondition: Description: Forbid or enforce yoda conditions. @@ -4348,7 +4484,7 @@ Style/YodaExpression: - "^" Style/ZeroLengthPredicate: Description: 'Use #empty? when testing for objects of length 0.' - Enabled: true + Enabled: false Safe: false VersionAdded: '0.37' VersionChanged: '0.39'