12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022 |
- 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/HashAlignment:
- EnforcedHashRocketStyle: key
- EnforcedColonStyle: key
- EnforcedLastArgumentHashStyle: ignore_implicit
- SupportedLastArgumentHashStyles:
- - always_inspect
- - always_ignore
- - ignore_implicit
- - ignore_explicit
- Layout/ParameterAlignment:
- 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
- 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/FirstArgumentIndentation:
- 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
- SafeAutoCorrect: true
- 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/FirstArrayElementIndentation:
- EnforcedStyle: consistent
- SupportedStyles:
- - special_inside_parentheses
- - consistent
- - align_brackets
- IndentationWidth:
- Layout/AssignmentIndentation:
- IndentationWidth:
- Layout/FirstHashElementIndentation:
- 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_
- ForbiddenPrefixes:
- - is_
- AllowedMethods:
- - 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/TrailingEmptyLines:
- EnforcedStyle: final_newline
- SupportedStyles:
- - final_newline
- - final_blank_line
- Style/TrivialAccessors:
- ExactNameMatch: true
- AllowPredicates: true
- AllowDSLWriters: false
- IgnoreClassMethods: false
- AllowedMethods:
- - 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
- Layout/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/ArrayAlignment:
- 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
- AllowOnConstant: 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
- Layout/IndentationStyle:
- Enabled: true
- Style/InfiniteLoop:
- Enabled: true
- Layout/LeadingCommentSpace:
- Enabled: true
- Style/LineEndConcatenation:
- Enabled: true
- Style/MethodCallWithoutArgsParentheses:
- Enabled: true
- Lint/MissingSuper:
- 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/TrailingWhitespace:
- Enabled: true
- Style/UnlessElse:
- Enabled: true
- Style/RedundantCapitalW:
- Enabled: true
- Style/RedundantInterpolation:
- Enabled: true
- Style/RedundantPercentQ:
- Enabled: true
- Style/VariableInterpolation:
- Enabled: true
- Style/WhenThen:
- Enabled: true
- Style/WhileUntilDo:
- Enabled: true
- Style/ZeroLengthPredicate:
- Enabled: true
- Layout/HeredocIndentation:
- Enabled: true
- 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/DuplicateHashKey:
- Enabled: true
- Lint/EachWithObjectArgument:
- Enabled: true
- Lint/ElseLayout:
- Enabled: true
- Lint/EmptyEnsure:
- Enabled: true
- Lint/EmptyInterpolation:
- Enabled: true
- Lint/EnsureReturn:
- Enabled: true
- Lint/FloatOutOfRange:
- Enabled: true
- Lint/FormatParameterMismatch:
- Enabled: true
- Lint/SuppressedException:
- AllowComments: 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/RedundantStringCoercion:
- Enabled: true
- Lint/UnderscorePrefixedVariableName:
- Enabled: true
- Lint/UnifiedInteger:
- Enabled: true
- Lint/RedundantCopDisableDirective:
- Enabled: true
- Lint/RedundantCopEnableDirective:
- Enabled: true
- Lint/RedundantSplatExpansion:
- Enabled: true
- Lint/UnreachableCode:
- Enabled: true
- Lint/UselessAccessModifier:
- ContextCreatingMethods: []
- Lint/UselessAssignment:
- Enabled: true
- Lint/BinaryOperatorWithIdenticalOperands:
- 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
- Lint/DeprecatedOpenSSLConstant:
- Enabled: true
|