From d67de1c9b28c986d93e861e8d56dc0156876e9bd Mon Sep 17 00:00:00 2001 From: Mike Angell Date: Thu, 29 Aug 2019 12:21:49 +1000 Subject: [PATCH] Follow Shopify ruby style This is the first step in bringing Liquid style inline with Shopify ruby style --- ...ify-github-io-ruby-style-guide-rubocop-yml | 1027 +++++++++++++++++ .rubocop.yml | 122 +- .rubocop_todo.yml | 426 ++++--- 3 files changed, 1276 insertions(+), 299 deletions(-) create mode 100644 .rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml diff --git a/.rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml b/.rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml new file mode 100644 index 000000000..5f5212ca8 --- /dev/null +++ b/.rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml @@ -0,0 +1,1027 @@ +AllCops: + Exclude: + - 'db/schema.rb' + DisabledByDefault: true + StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/ + +Lint/AssignmentInCondition: + Enabled: true + +Layout/AccessModifierIndentation: + EnforcedStyle: indent + SupportedStyles: + - outdent + - indent + IndentationWidth: + +Style/Alias: + EnforcedStyle: prefer_alias_method + SupportedStyles: + - prefer_alias + - prefer_alias_method + +Layout/AlignHash: + EnforcedHashRocketStyle: key + EnforcedColonStyle: key + EnforcedLastArgumentHashStyle: ignore_implicit + SupportedLastArgumentHashStyles: + - always_inspect + - always_ignore + - ignore_implicit + - ignore_explicit + +Layout/AlignParameters: + EnforcedStyle: with_fixed_indentation + SupportedStyles: + - with_first_parameter + - with_fixed_indentation + IndentationWidth: + +Style/AndOr: + EnforcedStyle: always + SupportedStyles: + - always + - conditionals + +Style/BarePercentLiterals: + EnforcedStyle: bare_percent + SupportedStyles: + - percent_q + - bare_percent + +Style/BlockDelimiters: + EnforcedStyle: line_count_based + SupportedStyles: + - line_count_based + - semantic + - braces_for_chaining + ProceduralMethods: + - benchmark + - bm + - bmbm + - create + - each_with_object + - measure + - new + - realtime + - tap + - with_object + FunctionalMethods: + - let + - let! + - subject + - watch + IgnoredMethods: + - lambda + - proc + - it + +Style/BracesAroundHashParameters: + EnforcedStyle: no_braces + SupportedStyles: + - braces + - no_braces + - context_dependent + +Layout/CaseIndentation: + EnforcedStyle: end + SupportedStyles: + - case + - end + IndentOneStep: false + IndentationWidth: + +Style/ClassAndModuleChildren: + EnforcedStyle: nested + SupportedStyles: + - nested + - compact + +Style/ClassCheck: + EnforcedStyle: is_a? + SupportedStyles: + - is_a? + - kind_of? + +Style/CommandLiteral: + EnforcedStyle: percent_x + SupportedStyles: + - backticks + - percent_x + - mixed + AllowInnerBackticks: false + +Style/CommentAnnotation: + Keywords: + - TODO + - FIXME + - OPTIMIZE + - HACK + - REVIEW + +Style/ConditionalAssignment: + EnforcedStyle: assign_to_condition + SupportedStyles: + - assign_to_condition + - assign_inside_condition + SingleLineConditionsOnly: true + +Layout/DotPosition: + EnforcedStyle: leading + SupportedStyles: + - leading + - trailing + +Style/EmptyElse: + EnforcedStyle: both + SupportedStyles: + - empty + - nil + - both + +Layout/EmptyLineBetweenDefs: + AllowAdjacentOneLineDefs: false + +Layout/EmptyLinesAroundBlockBody: + EnforcedStyle: no_empty_lines + SupportedStyles: + - empty_lines + - no_empty_lines + +Layout/EmptyLinesAroundClassBody: + EnforcedStyle: no_empty_lines + SupportedStyles: + - empty_lines + - empty_lines_except_namespace + - no_empty_lines + +Layout/EmptyLinesAroundModuleBody: + EnforcedStyle: no_empty_lines + SupportedStyles: + - empty_lines + - empty_lines_except_namespace + - no_empty_lines + +Layout/ExtraSpacing: + AllowForAlignment: true + ForceEqualSignAlignment: false + +Naming/FileName: + Exclude: [] + ExpectMatchingDefinition: false + Regex: + IgnoreExecutableScripts: true + +Layout/IndentFirstArgument: + EnforcedStyle: consistent + SupportedStyles: + - consistent + - special_for_inner_method_call + - special_for_inner_method_call_in_parentheses + IndentationWidth: + +Style/For: + EnforcedStyle: each + SupportedStyles: + - for + - each + +Style/FormatString: + EnforcedStyle: format + SupportedStyles: + - format + - sprintf + - percent + +Style/FrozenStringLiteralComment: + 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. + EnforcedStyle: always + SupportedStyles: + - always + - never + +Style/GlobalVars: + AllowedVariables: [] + +Style/HashSyntax: + EnforcedStyle: ruby19 + SupportedStyles: + - ruby19 + - hash_rockets + - no_mixed_keys + - ruby19_no_mixed_keys + UseHashRocketsWithSymbolValues: false + PreferHashRocketsForNonAlnumEndingSymbols: false + +Layout/IndentationConsistency: + EnforcedStyle: normal + SupportedStyles: + - normal + - rails + +Layout/IndentationWidth: + Width: 2 + +Layout/IndentFirstArrayElement: + EnforcedStyle: consistent + SupportedStyles: + - special_inside_parentheses + - consistent + - align_brackets + IndentationWidth: + +Layout/IndentAssignment: + IndentationWidth: + +Layout/IndentFirstHashElement: + EnforcedStyle: consistent + SupportedStyles: + - special_inside_parentheses + - consistent + - align_braces + IndentationWidth: + +Style/LambdaCall: + EnforcedStyle: call + SupportedStyles: + - call + - braces + +Style/Next: + EnforcedStyle: skip_modifier_ifs + MinBodyLength: 3 + SupportedStyles: + - skip_modifier_ifs + - always + +Style/NonNilCheck: + IncludeSemanticChanges: false + +Style/MethodCallWithArgsParentheses: + Enabled: true + IgnoreMacros: true + IgnoredMethods: + - require + - require_relative + - require_dependency + - yield + - raise + - puts + Exclude: + - Gemfile + +Style/MethodDefParentheses: + EnforcedStyle: require_parentheses + SupportedStyles: + - require_parentheses + - require_no_parentheses + - require_no_parentheses_except_multiline + +Naming/MethodName: + EnforcedStyle: snake_case + SupportedStyles: + - snake_case + - camelCase + +Layout/MultilineArrayBraceLayout: + EnforcedStyle: symmetrical + SupportedStyles: + - symmetrical + - new_line + - same_line + +Layout/MultilineHashBraceLayout: + EnforcedStyle: symmetrical + SupportedStyles: + - symmetrical + - new_line + - same_line + +Layout/MultilineMethodCallBraceLayout: + EnforcedStyle: symmetrical + SupportedStyles: + - symmetrical + - new_line + - same_line + +Layout/MultilineMethodCallIndentation: + EnforcedStyle: indented + SupportedStyles: + - aligned + - indented + - indented_relative_to_receiver + IndentationWidth: 2 + +Layout/MultilineMethodDefinitionBraceLayout: + EnforcedStyle: symmetrical + SupportedStyles: + - symmetrical + - new_line + - same_line + +Style/NumericLiteralPrefix: + EnforcedOctalStyle: zero_only + SupportedOctalStyles: + - zero_with_o + - zero_only + +Style/ParenthesesAroundCondition: + AllowSafeAssignment: true + +Style/PercentQLiterals: + EnforcedStyle: lower_case_q + SupportedStyles: + - lower_case_q + - upper_case_q + +Naming/PredicateName: + NamePrefix: + - is_ + NamePrefixBlacklist: + - is_ + NameWhitelist: + - is_a? + Exclude: + - 'spec/**/*' + +Style/PreferredHashMethods: + EnforcedStyle: short + SupportedStyles: + - short + - verbose + +Style/RaiseArgs: + EnforcedStyle: exploded + SupportedStyles: + - compact + - exploded + +Style/RedundantReturn: + AllowMultipleReturnValues: false + +Style/RegexpLiteral: + EnforcedStyle: mixed + SupportedStyles: + - slashes + - percent_r + - mixed + AllowInnerSlashes: false + +Style/SafeNavigation: + ConvertCodeThatCanStartToReturnNil: false + Enabled: true + +Lint/SafeNavigationChain: + Enabled: true + +Style/Semicolon: + AllowAsExpressionSeparator: false + +Style/SignalException: + EnforcedStyle: only_raise + SupportedStyles: + - only_raise + - only_fail + - semantic + +Style/SingleLineMethods: + AllowIfMethodIsEmpty: true + +Layout/SpaceBeforeFirstArg: + AllowForAlignment: true + +Style/SpecialGlobalVars: + EnforcedStyle: use_english_names + SupportedStyles: + - use_perl_names + - use_english_names + +Style/StabbyLambdaParentheses: + EnforcedStyle: require_parentheses + SupportedStyles: + - require_parentheses + - require_no_parentheses + +Style/StringLiteralsInInterpolation: + EnforcedStyle: single_quotes + SupportedStyles: + - single_quotes + - double_quotes + +Layout/SpaceAroundBlockParameters: + EnforcedStyleInsidePipes: no_space + SupportedStylesInsidePipes: + - space + - no_space + +Layout/SpaceAroundEqualsInParameterDefault: + EnforcedStyle: space + SupportedStyles: + - space + - no_space + +Layout/SpaceAroundOperators: + AllowForAlignment: true + +Layout/SpaceBeforeBlockBraces: + EnforcedStyle: space + EnforcedStyleForEmptyBraces: space + SupportedStyles: + - space + - no_space + +Layout/SpaceInsideBlockBraces: + EnforcedStyle: space + SupportedStyles: + - space + - no_space + EnforcedStyleForEmptyBraces: no_space + SpaceBeforeBlockParameters: true + +Layout/SpaceInsideHashLiteralBraces: + EnforcedStyle: space + EnforcedStyleForEmptyBraces: no_space + SupportedStyles: + - space + - no_space + - compact + +Layout/SpaceInsideStringInterpolation: + EnforcedStyle: no_space + SupportedStyles: + - space + - no_space + +Style/SymbolProc: + IgnoredMethods: + - respond_to + - define_method + +Style/TernaryParentheses: + EnforcedStyle: require_no_parentheses + SupportedStyles: + - require_parentheses + - require_no_parentheses + AllowSafeAssignment: true + +Layout/TrailingBlankLines: + EnforcedStyle: final_newline + SupportedStyles: + - final_newline + - final_blank_line + +Style/TrivialAccessors: + ExactNameMatch: true + AllowPredicates: true + AllowDSLWriters: false + IgnoreClassMethods: false + Whitelist: + - to_ary + - to_a + - to_c + - to_enum + - to_h + - to_hash + - to_i + - to_int + - to_io + - to_open + - to_path + - to_proc + - to_r + - to_regexp + - to_str + - to_s + - to_sym + +Naming/VariableName: + EnforcedStyle: snake_case + SupportedStyles: + - snake_case + - camelCase + +Style/WhileUntilModifier: + Enabled: true + +Metrics/BlockNesting: + Max: 3 + +Metrics/LineLength: + Max: 120 + AllowHeredoc: true + AllowURI: true + URISchemes: + - http + - https + IgnoreCopDirectives: false + IgnoredPatterns: + - '\A\s*(remote_)?test(_\w+)?\s.*(do|->)(\s|\Z)' + +Metrics/ParameterLists: + Max: 5 + CountKeywordArgs: false + +Layout/BlockAlignment: + EnforcedStyleAlignWith: either + SupportedStylesAlignWith: + - either + - start_of_block + - start_of_line + +Layout/EndAlignment: + EnforcedStyleAlignWith: variable + SupportedStylesAlignWith: + - keyword + - variable + - start_of_line + +Layout/DefEndAlignment: + EnforcedStyleAlignWith: start_of_line + SupportedStylesAlignWith: + - start_of_line + - def + +Lint/InheritException: + EnforcedStyle: runtime_error + SupportedStyles: + - runtime_error + - standard_error + +Lint/UnusedBlockArgument: + IgnoreEmptyBlocks: true + AllowUnusedKeywordArguments: false + +Lint/UnusedMethodArgument: + AllowUnusedKeywordArguments: false + IgnoreEmptyMethods: true + +Naming/AccessorMethodName: + Enabled: true + +Layout/AlignArray: + Enabled: true + +Style/ArrayJoin: + Enabled: true + +Naming/AsciiIdentifiers: + Enabled: true + +Style/Attr: + Enabled: true + +Style/BeginBlock: + Enabled: true + +Style/BlockComments: + Enabled: true + +Layout/BlockEndNewline: + Enabled: true + +Style/CaseEquality: + Enabled: true + +Style/CharacterLiteral: + Enabled: true + +Naming/ClassAndModuleCamelCase: + Enabled: true + +Style/ClassMethods: + Enabled: true + +Style/ClassVars: + Enabled: true + +Layout/ClosingParenthesisIndentation: + Enabled: true + +Style/ColonMethodCall: + Enabled: true + +Layout/CommentIndentation: + Enabled: true + +Naming/ConstantName: + Enabled: true + +Style/DateTime: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +Style/EachForSimpleLoop: + Enabled: true + +Style/EachWithObject: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Style/EmptyCaseCondition: + Enabled: true + +Layout/EmptyLines: + Enabled: true + +Layout/EmptyLinesAroundAccessModifier: + Enabled: true + +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +Style/EmptyLiteral: + Enabled: true + +Style/EndBlock: + Enabled: true + +Layout/EndOfLine: + Enabled: true + +Style/EvenOdd: + Enabled: true + +Layout/InitialIndentation: + Enabled: true + +Lint/FlipFlop: + Enabled: true + +Style/IfInsideElse: + Enabled: true + +Style/IfUnlessModifierOfIfUnless: + Enabled: true + +Style/IfWithSemicolon: + Enabled: true + +Style/IdenticalConditionalBranches: + Enabled: true + +Style/InfiniteLoop: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Style/LineEndConcatenation: + Enabled: true + +Style/MethodCallWithoutArgsParentheses: + Enabled: true + +Style/MethodMissingSuper: + Enabled: true + +Style/MissingRespondToMissing: + Enabled: true + +Layout/MultilineBlockLayout: + Enabled: true + +Style/MultilineIfThen: + Enabled: true + +Style/MultilineMemoization: + Enabled: true + +Style/MultilineTernaryOperator: + Enabled: true + +Style/NegatedIf: + Enabled: true + +Style/NegatedWhile: + Enabled: true + +Style/NestedModifier: + Enabled: true + +Style/NestedParenthesizedCalls: + Enabled: true + +Style/NestedTernaryOperator: + Enabled: true + +Style/NilComparison: + Enabled: true + +Style/Not: + Enabled: true + +Style/OneLineConditional: + Enabled: true + +Naming/BinaryOperatorParameterName: + Enabled: true + +Style/OptionalArguments: + Enabled: true + +Style/ParallelAssignment: + Enabled: true + +Style/PerlBackrefs: + Enabled: true + +Style/Proc: + Enabled: true + +Style/RedundantBegin: + Enabled: true + +Style/RedundantException: + Enabled: true + +Style/RedundantFreeze: + Enabled: true + +Style/RedundantParentheses: + Enabled: true + +Style/RedundantSelf: + Enabled: true + +Style/RedundantSortBy: + Enabled: true + +Layout/RescueEnsureAlignment: + Enabled: true + +Style/RescueModifier: + Enabled: true + +Style/Sample: + Enabled: true + +Style/SelfAssignment: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAfterMethodName: + Enabled: true + +Layout/SpaceAfterNot: + Enabled: true + +Layout/SpaceAfterSemicolon: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeComment: + Enabled: true + +Layout/SpaceBeforeSemicolon: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceInsideArrayPercentLiteral: + Enabled: true + +Layout/SpaceInsidePercentLiteralDelimiters: + Enabled: true + +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +Layout/SpaceInsideRangeLiteral: + Enabled: true + +Style/SymbolLiteral: + Enabled: true + +Layout/Tab: + Enabled: true + +Layout/TrailingWhitespace: + Enabled: true + +Style/UnlessElse: + Enabled: true + +Style/UnneededCapitalW: + Enabled: true + +Style/UnneededInterpolation: + Enabled: true + +Style/UnneededPercentQ: + Enabled: true + +Style/VariableInterpolation: + Enabled: true + +Style/WhenThen: + Enabled: true + +Style/WhileUntilDo: + Enabled: true + +Style/ZeroLengthPredicate: + Enabled: true + +Layout/IndentHeredoc: + EnforcedStyle: squiggly + +Lint/AmbiguousOperator: + Enabled: true + +Lint/AmbiguousRegexpLiteral: + Enabled: true + +Lint/CircularArgumentReference: + Enabled: true + +Layout/ConditionPosition: + Enabled: true + +Lint/Debugger: + Enabled: true + +Lint/DeprecatedClassMethods: + Enabled: true + +Lint/DuplicateMethods: + Enabled: true + +Lint/DuplicatedKey: + Enabled: true + +Lint/EachWithObjectArgument: + Enabled: true + +Lint/ElseLayout: + Enabled: true + +Lint/EmptyEnsure: + Enabled: true + +Lint/EmptyInterpolation: + Enabled: true + +Lint/EndInMethod: + Enabled: true + +Lint/EnsureReturn: + Enabled: true + +Lint/FloatOutOfRange: + Enabled: true + +Lint/FormatParameterMismatch: + Enabled: true + +Lint/HandleExceptions: + Enabled: true + +Lint/ImplicitStringConcatenation: + Description: Checks for adjacent string literals on the same line, which could + better be represented as a single string literal. + +Lint/IneffectiveAccessModifier: + Description: Checks for attempts to use `private` or `protected` to set the visibility + of a class method, which does not work. + +Lint/LiteralAsCondition: + Enabled: true + +Lint/LiteralInInterpolation: + Enabled: true + +Lint/Loop: + Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while + for post-loop tests. + +Lint/NestedMethodDefinition: + Enabled: true + +Lint/NextWithoutAccumulator: + Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` + block. + +Lint/NonLocalExitFromIterator: + Enabled: true + +Lint/ParenthesesAsGroupedExpression: + Enabled: true + +Lint/PercentStringArray: + Enabled: true + +Lint/PercentSymbolArray: + Enabled: true + +Lint/RandOne: + Description: Checks for `rand(1)` calls. Such calls always return `0` and most + likely a mistake. + +Lint/RequireParentheses: + Enabled: true + +Lint/RescueException: + Enabled: true + +Lint/ShadowedException: + Enabled: true + +Lint/ShadowingOuterLocalVariable: + Enabled: true + +Lint/StringConversionInInterpolation: + Enabled: true + +Lint/UnderscorePrefixedVariableName: + Enabled: true + +Lint/UnifiedInteger: + Enabled: true + +Lint/UnneededCopDisableDirective: + Enabled: true + +Lint/UnneededCopEnableDirective: + Enabled: true + +Lint/UnneededSplatExpansion: + Enabled: true + +Lint/UnreachableCode: + Enabled: true + +Lint/UselessAccessModifier: + ContextCreatingMethods: [] + +Lint/UselessAssignment: + Enabled: true + +Lint/UselessComparison: + Enabled: true + +Lint/UselessElseWithoutRescue: + Enabled: true + +Lint/UselessSetterCall: + Enabled: true + +Lint/Void: + Enabled: true + +Security/Eval: + Enabled: true + +Security/JSONLoad: + Enabled: true + +Security/Open: + Enabled: true + +Lint/BigDecimalNew: + Enabled: true + +Style/Strip: + Enabled: true + +Style/TrailingBodyOnClass: + Enabled: true + +Style/TrailingBodyOnModule: + Enabled: true + +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma + Enabled: true + +Style/TrailingCommaInHashLiteral: + EnforcedStyleForMultiline: comma + Enabled: true + +Layout/SpaceInsideReferenceBrackets: + EnforcedStyle: no_space + EnforcedStyleForEmptyBrackets: no_space + Enabled: true + +Style/ModuleFunction: + EnforcedStyle: extend_self + +Lint/OrderedMagicComments: + Enabled: true diff --git a/.rubocop.yml b/.rubocop.yml index 671f07688..6b9aa9fed 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ inherit_from: + - https://shopify.github.io/ruby-style-guide/rubocop.yml - .rubocop_todo.yml - - ./.rubocop_todo.yml require: rubocop-performance @@ -9,124 +9,8 @@ Performance: AllCops: Exclude: - - 'performance/shopify/*' - 'vendor/bundle/**/*' - - 'pkg/**' - -Metrics/BlockNesting: - Max: 3 - -Metrics/ModuleLength: - Enabled: false - -Metrics/ClassLength: - Enabled: false - -Lint/AssignmentInCondition: - Enabled: false - -Lint/AmbiguousOperator: - Enabled: false - -Lint/AmbiguousRegexpLiteral: - Enabled: false - -Lint/ParenthesesAsGroupedExpression: - Enabled: false - -Lint/UnusedBlockArgument: - Enabled: false - -Layout/EndAlignment: - EnforcedStyleAlignWith: variable - -Lint/UnusedMethodArgument: - Enabled: false - -Style/SingleLineBlockParams: - Enabled: false - -Style/DoubleNegation: - Enabled: false - -Style/StringLiteralsInInterpolation: - Enabled: false - -Style/AndOr: - Enabled: false - -Style/SignalException: - Enabled: false - -Style/StringLiterals: - Enabled: false - -Style/BracesAroundHashParameters: - Enabled: false - -Style/NumericLiterals: - Enabled: false - -Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false - -Layout/SpaceBeforeBlockBraces: - Enabled: false - -Style/Documentation: - Enabled: false - -Style/ClassAndModuleChildren: - Enabled: false - -Style/TrailingCommaInArrayLiteral: - Enabled: false - -Style/TrailingCommaInHashLiteral: - Enabled: false - -Style/FormatString: - Enabled: false - -Layout/AlignParameters: - EnforcedStyle: with_fixed_indentation - -Layout/MultilineOperationIndentation: - EnforcedStyle: indented - -Style/IfUnlessModifier: - Enabled: false - -Style/RaiseArgs: - Enabled: false - -Style/PreferredHashMethods: - Enabled: false - -Style/RegexpLiteral: - Enabled: false - -Style/SymbolLiteral: - Enabled: false - -Naming/ConstantName: - Enabled: false - -Layout/CaseIndentation: - Enabled: false - -Style/ClassVars: - Enabled: false - -Style/PerlBackrefs: - Enabled: false - -Style/TrivialAccessors: - AllowPredicates: true - -Style/WordArray: - Enabled: false - + Naming/MethodName: Exclude: - - 'example/server/liquid_servlet.rb' + - 'example/server/liquid_servlet.rb' \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 992d135a9..22330ae6b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,34 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-08-29 00:43:36 +1000 using RuboCop version 0.74.0. +# on 2019-08-29 12:16:25 +1000 using RuboCop version 0.74.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: TreatCommentsAsGroupSeparators, Include. -# Include: **/*.gemspec -Gemspec/OrderedDependencies: - Exclude: - - 'liquid.gemspec' - -# Offense count: 1 -# Configuration parameters: Include. -# Include: **/*.gemspec, -Gemspec/RequiredRubyVersion: - Exclude: - - 'liquid.gemspec' - -# Offense count: 124 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: with_first_argument, with_fixed_indentation -Layout/AlignArguments: - Enabled: false - -# Offense count: 7 +# Offense count: 13 # Cop supports --auto-correct. # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table @@ -38,32 +16,17 @@ Layout/AlignHash: Exclude: - 'lib/liquid/condition.rb' - 'lib/liquid/expression.rb' + - 'performance/shopify/comment_form.rb' + - 'performance/shopify/database.rb' + - 'performance/shopify/paginate.rb' - 'test/unit/context_unit_test.rb' -# Offense count: 6 -# Cop supports --auto-correct. -Layout/ClosingHeredocIndentation: - Exclude: - - 'test/integration/tags/for_tag_test.rb' - -# Offense count: 27 +# Offense count: 3 # Cop supports --auto-correct. -Layout/EmptyLineAfterGuardClause: +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: Exclude: - - 'lib/liquid/block.rb' - - 'lib/liquid/block_body.rb' - - 'lib/liquid/context.rb' - - 'lib/liquid/drop.rb' - - 'lib/liquid/lexer.rb' - - 'lib/liquid/parser.rb' - - 'lib/liquid/standardfilters.rb' - - 'lib/liquid/strainer.rb' - - 'lib/liquid/tags/for.rb' - - 'lib/liquid/tags/if.rb' - - 'lib/liquid/tags/include.rb' - - 'lib/liquid/utils.rb' - - 'lib/liquid/variable.rb' - - 'lib/liquid/variable_lookup.rb' + - 'performance/shopify/paginate.rb' # Offense count: 5 # Cop supports --auto-correct. @@ -83,12 +46,61 @@ Layout/MultilineMethodCallBraceLayout: - 'test/integration/error_handling_test.rb' - 'test/unit/strainer_unit_test.rb' -# Offense count: 1 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Layout/SpaceAroundOperators: Exclude: - 'lib/liquid/condition.rb' + - 'performance/shopify/paginate.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'example/server/server.rb' + - 'lib/liquid/variable.rb' + - 'test/integration/drop_test.rb' + - 'test/integration/standard_filter_test.rb' + - 'test/integration/tags/if_else_tag_test.rb' + +# Offense count: 19 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'test/integration/drop_test.rb' + - 'test/integration/standard_filter_test.rb' + - 'test/integration/tags/for_tag_test.rb' + - 'test/integration/tags/include_tag_test.rb' + - 'test/integration/tags/standard_tag_test.rb' + - 'test/unit/context_unit_test.rb' + +# Offense count: 2 +Lint/AmbiguousOperator: + Exclude: + - 'test/unit/condition_unit_test.rb' + +# Offense count: 16 +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: + Exclude: + - 'lib/liquid/block_body.rb' + - 'lib/liquid/lexer.rb' + - 'lib/liquid/standardfilters.rb' + - 'lib/liquid/tags/for.rb' + - 'lib/liquid/tags/if.rb' + - 'lib/liquid/tags/include.rb' + - 'lib/liquid/tags/raw.rb' + - 'lib/liquid/variable.rb' + - 'performance/profile.rb' + - 'test/test_helper.rb' + - 'test/unit/tokenizer_unit_test.rb' # Offense count: 2 # Cop supports --auto-correct. @@ -98,159 +110,184 @@ Lint/InheritException: Exclude: - 'lib/liquid/interrupts.rb' -# Offense count: 1 -# Configuration parameters: CheckForMethodsWithNoSideEffects. -Lint/Void: +# Offense count: 10 +# Cop supports --auto-correct. +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: Exclude: + - 'lib/liquid/condition.rb' + - 'lib/liquid/context.rb' + - 'lib/liquid/document.rb' - 'lib/liquid/parse_context.rb' - -# Offense count: 53 -Metrics/AbcSize: - Max: 56 + - 'lib/liquid/template.rb' + - 'performance/shopify/json_filter.rb' + - 'test/integration/filter_test.rb' + - 'test/integration/render_profiling_test.rb' + - 'test/integration/variable_test.rb' + - 'test/unit/condition_unit_test.rb' # Offense count: 12 -Metrics/CyclomaticComplexity: - Max: 13 - -# Offense count: 118 -# Configuration parameters: CountComments, ExcludedMethods. -Metrics/MethodLength: - Max: 38 +# Cop supports --auto-correct. +# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods. +Lint/UnusedMethodArgument: + Exclude: + - 'example/server/liquid_servlet.rb' + - 'test/integration/blank_test.rb' + - 'test/integration/error_handling_test.rb' + - 'test/integration/filter_test.rb' + - 'test/integration/output_test.rb' + - 'test/integration/standard_filter_test.rb' + - 'test/integration/tags/include_tag_test.rb' + - 'test/unit/strainer_unit_test.rb' -# Offense count: 9 -Metrics/PerceivedComplexity: - Max: 11 +# Offense count: 2 +Lint/UselessAssignment: + Exclude: + - 'performance/shopify/database.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: PreferredName. -Naming/RescuedExceptionsVariableName: +# Configuration parameters: CheckForMethodsWithNoSideEffects. +Lint/Void: Exclude: - - 'lib/liquid/context.rb' + - 'lib/liquid/parse_context.rb' + +# Offense count: 95 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 294 -# Offense count: 20 -# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: io, id, to, by, on, in, at, ip, db -Naming/UncommunicativeMethodParamName: +# Offense count: 44 +Naming/ConstantName: Exclude: - - 'example/server/example_servlet.rb' - - 'lib/liquid/condition.rb' - - 'lib/liquid/context.rb' - - 'lib/liquid/standardfilters.rb' + - 'lib/liquid.rb' + - 'lib/liquid/block_body.rb' + - 'lib/liquid/tags/assign.rb' + - 'lib/liquid/tags/capture.rb' + - 'lib/liquid/tags/case.rb' + - 'lib/liquid/tags/cycle.rb' + - 'lib/liquid/tags/for.rb' - 'lib/liquid/tags/if.rb' + - 'lib/liquid/tags/include.rb' + - 'lib/liquid/tags/raw.rb' + - 'lib/liquid/tags/table_row.rb' - 'lib/liquid/variable.rb' - - 'test/integration/filter_test.rb' - - 'test/integration/standard_filter_test.rb' - - 'test/integration/template_test.rb' - - 'test/unit/condition_unit_test.rb' + - 'performance/shopify/comment_form.rb' + - 'performance/shopify/paginate.rb' + - 'test/integration/tags/include_tag_test.rb' -# Offense count: 5 +# Offense count: 2 +# Configuration parameters: . +# SupportedStyles: snake_case, camelCase +Naming/MethodName: + EnforcedStyle: snake_case + +# Offense count: 3 +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. -# SupportedStyles: inline, group -Style/AccessModifierDeclarations: +# SupportedStyles: always, conditionals +Style/AndOr: Exclude: - - 'lib/liquid/block_body.rb' - - 'lib/liquid/tag.rb' - - 'lib/liquid/tags/include.rb' - - 'test/unit/strainer_unit_test.rb' + - 'lib/liquid/i18n.rb' + - 'lib/liquid/tags/table_row.rb' + - 'lib/liquid/tokenizer.rb' -# Offense count: 10 +# Offense count: 40 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. -# SupportedStyles: prefer_alias, prefer_alias_method -Style/Alias: +# SupportedStyles: braces, no_braces, context_dependent +Style/BracesAroundHashParameters: Exclude: - - 'lib/liquid/drop.rb' - - 'lib/liquid/i18n.rb' - - 'lib/liquid/profiler/hooks.rb' - - 'lib/liquid/standardfilters.rb' - - 'lib/liquid/tag.rb' - - 'lib/liquid/tags/include.rb' - - 'lib/liquid/variable.rb' + - 'test/integration/error_handling_test.rb' + - 'test/integration/filter_test.rb' + - 'test/integration/render_profiling_test.rb' + - 'test/integration/standard_filter_test.rb' + - 'test/integration/tags/echo_test.rb' + - 'test/integration/tags/increment_tag_test.rb' + - 'test/integration/tags/standard_tag_test.rb' + - 'test/integration/template_test.rb' + - 'test/unit/condition_unit_test.rb' + - 'test/unit/context_unit_test.rb' -# Offense count: 22 -Style/CommentedKeyword: - Enabled: false +# Offense count: 5 +Style/ClassVars: + Exclude: + - 'lib/liquid/condition.rb' + - 'lib/liquid/strainer.rb' + - 'lib/liquid/template.rb' -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition Style/ConditionalAssignment: Exclude: - 'lib/liquid/errors.rb' + - 'performance/shopify/shop_filter.rb' # Offense count: 1 -# Cop supports --auto-correct. -Style/EmptyCaseCondition: +# Configuration parameters: AllowCoercion. +Style/DateTime: Exclude: - - 'lib/liquid/lexer.rb' + - 'test/unit/context_unit_test.rb' -# Offense count: 5 +# Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: compact, expanded -Style/EmptyMethod: +Style/EachWithObject: Exclude: - - 'lib/liquid/tag.rb' - - 'lib/liquid/tags/comment.rb' - - 'lib/liquid/tags/include.rb' - - 'test/integration/tags/include_tag_test.rb' - - 'test/unit/context_unit_test.rb' + - 'performance/shopify/database.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. -Style/Encoding: +Style/EmptyCaseCondition: Exclude: - - 'lib/liquid/version.rb' - - 'liquid.gemspec' - - 'test/integration/standard_filter_test.rb' + - 'lib/liquid/lexer.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. -Style/ExpandPathArguments: +# Configuration parameters: EnforcedStyle. +# SupportedStyles: each, for +Style/For: Exclude: - - 'Rakefile' - - 'liquid.gemspec' + - 'performance/shopify/shop_filter.rb' -# Offense count: 7 +# Offense count: 9 +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. -# SupportedStyles: annotated, template, unannotated -Style/FormatStringToken: +# SupportedStyles: format, sprintf, percent +Style/FormatString: Exclude: + - 'example/server/example_servlet.rb' + - 'performance/shopify/money_filter.rb' + - 'performance/shopify/weight_filter.rb' - 'test/integration/filter_test.rb' - 'test/integration/hash_ordering_test.rb' -# Offense count: 106 +# Offense count: 115 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, never Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 14 -# Configuration parameters: MinBodyLength. -Style/GuardClause: +# Offense count: 30 +# Cop supports --auto-correct. +# Configuration parameters: IgnoreMacros, IgnoredMethods, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle. +# SupportedStyles: require_parentheses, omit_parentheses +Style/MethodCallWithArgsParentheses: Exclude: - - 'lib/liquid/condition.rb' - - 'lib/liquid/lexer.rb' - - 'lib/liquid/strainer.rb' - - 'lib/liquid/tags/assign.rb' - - 'lib/liquid/tags/capture.rb' - - 'lib/liquid/tags/case.rb' + - 'Gemfile' + - 'Rakefile' + - 'lib/liquid/block_body.rb' + - 'lib/liquid/parser.rb' - 'lib/liquid/tags/for.rb' - - 'lib/liquid/tags/include.rb' - - 'lib/liquid/tags/raw.rb' - - 'lib/liquid/tags/table_row.rb' - - 'lib/liquid/variable.rb' - - 'test/unit/tokenizer_unit_test.rb' - -# Offense count: 53 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: literals, strict -Style/MutableConstant: - Enabled: false + - 'liquid.gemspec' + - 'performance/shopify/database.rb' + - 'performance/shopify/liquid.rb' + - 'test/test_helper.rb' + - 'test/unit/condition_unit_test.rb' + - 'test/unit/tags/if_tag_unit_test.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -260,29 +297,17 @@ Style/Next: Exclude: - 'lib/liquid/tags/for.rb' -# Offense count: 13 +# Offense count: 52 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Exclude: - - 'spec/**/*' - - 'lib/liquid/context.rb' - - 'lib/liquid/forloop_drop.rb' - - 'lib/liquid/standardfilters.rb' - - 'lib/liquid/tablerowloop_drop.rb' - - 'test/integration/standard_filter_test.rb' - - 'test/integration/template_test.rb' +Style/PerlBackrefs: + Enabled: false -# Offense count: 14 +# Offense count: 33 # Cop supports --auto-correct. -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Exclude: - - 'lib/liquid/tags/if.rb' - - 'liquid.gemspec' - - 'test/integration/assign_test.rb' - - 'test/integration/standard_filter_test.rb' +# Configuration parameters: EnforcedStyle. +# SupportedStyles: compact, exploded +Style/RaiseArgs: + Enabled: false # Offense count: 1 # Cop supports --auto-correct. @@ -290,6 +315,17 @@ Style/RedundantSelf: Exclude: - 'lib/liquid/strainer.rb' +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: + Exclude: + - 'lib/liquid/file_system.rb' + - 'lib/liquid/standardfilters.rb' + - 'performance/shopify/shop_filter.rb' + - 'test/unit/condition_unit_test.rb' + # Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist. @@ -300,21 +336,31 @@ Style/SafeNavigation: - 'lib/liquid/strainer.rb' - 'lib/liquid/tokenizer.rb' -# Offense count: 9 +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: AllowAsExpressionSeparator. Style/Semicolon: Exclude: + - 'performance/shopify/database.rb' - 'test/integration/error_handling_test.rb' - 'test/integration/template_test.rb' - 'test/unit/context_unit_test.rb' -# Offense count: 7 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: MinSize. -# SupportedStyles: percent, brackets -Style/SymbolArray: - EnforcedStyle: brackets +# Configuration parameters: EnforcedStyle. +# SupportedStyles: use_perl_names, use_english_names +Style/SpecialGlobalVars: + Exclude: + - 'performance/shopify/liquid.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiteralsInInterpolation: + Exclude: + - 'performance/shopify/tag_filter.rb' # Offense count: 2 # Cop supports --auto-correct. @@ -325,6 +371,33 @@ Style/TernaryParentheses: - 'lib/liquid/context.rb' - 'lib/liquid/utils.rb' +# Offense count: 21 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'lib/liquid/parse_tree_visitor.rb' + - 'lib/liquid/tags/include.rb' + - 'test/integration/parse_tree_visitor_test.rb' + - 'test/integration/standard_filter_test.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'lib/liquid/condition.rb' + - 'lib/liquid/lexer.rb' + - 'lib/liquid/standardfilters.rb' + - 'performance/shopify/comment_form.rb' + - 'performance/shopify/database.rb' + - 'performance/shopify/paginate.rb' + - 'performance/theme_runner.rb' + - 'test/integration/output_test.rb' + - 'test/unit/context_unit_test.rb' + # Offense count: 2 # Cop supports --auto-correct. Style/UnneededPercentQ: @@ -336,10 +409,3 @@ Style/UnneededPercentQ: Style/WhileUntilModifier: Exclude: - 'lib/liquid/tags/case.rb' - -# Offense count: 665 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 294