1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027 |
- 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
|