AllCops: # Cop names are not displayed in offense messages by default. Change behavior # by overriding DisplayCopNames, or by giving the `-D/--display-cop-names` # option. DisplayCopNames: true # Style guide URLs are not displayed in offense messages by default. Change # behavior by overriding `DisplayStyleGuide`, or by giving the # `-S/--display-style-guide` option. DisplayStyleGuide: true # Extra details are not displayed in offense messages by default. Change # behavior by overriding ExtraDetails, or by giving the # `-E/--extra-details` option. ExtraDetails: true # What MRI version of the Ruby interpreter is the inspected code intended to # run on? (If there is more than one, set this to the lowest version.) # If a value is specified for TargetRubyVersion then it is used. # Else if .ruby-version exists and it contains an MRI version it is used. # Otherwise we fallback to the oldest officially supported Ruby version (2.1). TargetRubyVersion: 2.5.1 TargetRailsVersion: 5.2.0 # Align the elements of a hash literal if they span more than one line. Layout/AlignHash: # Alignment of entries using hash rocket as separator. Valid values are: # # key - left alignment of keys # 'a' => 2 # 'bb' => 3 # separator - alignment of hash rockets, keys are right aligned # 'a' => 2 # 'bb' => 3 # table - left alignment of keys, hash rockets, and values # 'a' => 2 # 'bb' => 3 EnforcedHashRocketStyle: table SupportedHashRocketStyles: - key - separator - table # Alignment of entries using colon as separator. Valid values are: # # key - left alignment of keys # a: 0 # bb: 1 # separator - alignment of colons, keys are right aligned # a: 0 # bb: 1 # table - left alignment of keys and values # a: 0 # bb: 1 EnforcedColonStyle: table SupportedColonStyles: - key - separator - table # Select whether hashes that are the last argument in a method call should be # inspected? Valid values are: # # always_inspect - Inspect both implicit and explicit hashes. # Registers an offense for: # function(a: 1, # b: 2) # Registers an offense for: # function({a: 1, # b: 2}) # always_ignore - Ignore both implicit and explicit hashes. # Accepts: # function(a: 1, # b: 2) # Accepts: # function({a: 1, # b: 2}) # ignore_implicit - Ignore only implicit hashes. # Accepts: # function(a: 1, # b: 2) # Registers an offense for: # function({a: 1, # b: 2}) # ignore_explicit - Ignore only explicit hashes. # Accepts: # function({a: 1, # b: 2}) # Registers an offense for: # function(a: 1, # b: 2) EnforcedLastArgumentHashStyle: ignore_implicit SupportedLastArgumentHashStyles: - always_inspect - always_ignore - ignore_implicit - ignore_explicit Layout/EndOfLine: # The `native` style means that CR+LF (Carriage Return + Line Feed) is # enforced on Windows, and LF is enforced on other platforms. The other styles # mean LF and CR+LF, respectively. EnforcedStyle: lf SupportedStyles: - native - lf - crlf Style/BlockDelimiters: EnforcedStyle: braces_for_chaining SupportedStyles: # The `line_count_based` style enforces braces around single line blocks and # do..end around multi-line blocks. - line_count_based # The `semantic` style enforces braces around functional blocks, where the # primary purpose of the block is to return a value and do..end for # procedural blocks, where the primary purpose of the block is its # side-effects. # # This looks at the usage of a block's method to determine its type (e.g. is # the result of a `map` assigned to a variable or passed to another # method) but exceptions are permitted in the `ProceduralMethods`, # `FunctionalMethods` and `IgnoredMethods` sections below. - semantic # The `braces_for_chaining` style enforces braces around single line blocks # and do..end around multi-line blocks, except for multi-line blocks whose # return value is being chained with another method (in which case braces # are enforced). - braces_for_chaining Style/Documentation: Enabled: false Style/MethodDefParentheses: EnforcedStyle: require_no_parentheses SupportedStyles: - require_parentheses - require_no_parentheses - require_no_parentheses_except_multiline Style/RedundantReturn: # When `true` allows code like `return x, y`. AllowMultipleReturnValues: true Style/Semicolon: # Allow `;` to separate several expressions on the same line. AllowAsExpressionSeparator: true Metrics/BlockLength: Exclude: - "**/*_spec.rb" Metrics/LineLength: Max: 100 # To make it possible to copy or click on URIs in the code, we allow lines # containing a URI to be longer than Max. AllowHeredoc: true AllowURI: true URISchemes: - http - https - ftp # The IgnoreCopDirectives option causes the LineLength rule to ignore cop # directives like '# rubocop: enable ...' when calculating a line's length. IgnoreCopDirectives: false # The IgnoredPatterns option is a list of !ruby/regexp and/or string # elements. Strings will be converted to Regexp objects. A line that matches # any regular expression listed in this option will be ignored by LineLength. IgnoredPatterns: [] # Align ends correctly. Lint/EndAlignment: # The value `keyword` means that `end` should be aligned with the matching # keyword (`if`, `while`, etc.). # The value `variable` means that in assignments, `end` should be aligned # with the start of the variable on the left hand side of `=`. In all other # situations, `end` should still be aligned with the keyword. # The value `start_of_line` means that `end` should be aligned with the start # of the line which the matching keyword appears on. EnforcedStyleAlignWith: variable SupportedStylesAlignWith: - keyword - variable - start_of_line AutoCorrect: false