---
linters:
  ClosingErbTagIndent:
    enabled: true
  ErbSafety:
    enabled: true
  ExtraNewline:
    enabled: true
  FinalNewline:
    enabled: true
  SelfClosingTag:
    enabled: false
  SpaceAroundErbTag:
    enabled: true
  SpaceIndentation:
    enabled: true
  SpaceInHtmlTag:
    enabled: true
  TrailingWhitespace:
    enabled: true
  Rubocop:
    enabled: true
    only:
      - Layout/EndOfLine
      - Layout/SpaceAfterColon
      - Layout/SpaceAfterComma
      - Layout/SpaceAfterMethodName
      - Layout/SpaceAfterNot
      - Layout/SpaceAfterSemicolon
      - Layout/SpaceAroundBlockParameters
      - Layout/SpaceAroundOperators
      - Layout/SpaceBeforeBlockBraces
      - Layout/SpaceBeforeComma
      - Layout/SpaceBeforeComment
      - Layout/SpaceBeforeFirstArg
      - Layout/SpaceBeforeSemicolon
      - Layout/SpaceInsideArrayLiteralBrackets
      - Layout/SpaceInsideArrayPercentLiteral
      - Layout/SpaceInsideBlockBraces
      - Layout/SpaceInsideHashLiteralBraces
      - Layout/SpaceInsideParens
      - Layout/SpaceInsidePercentLiteralDelimiters
      - Layout/SpaceInsideRangeLiteral
      - Layout/SpaceInsideReferenceBrackets
      - Layout/SpaceInsideStringInterpolation
      - Layout/Tab
      - Lint/LiteralAsCondition
      - Style/PercentLiteralDelimiters

---
linters:
  ClosingErbTagIndent:
    enabled: true
  ErbSafety:
    enabled: true
  ExtraNewline:
    enabled: true
  FinalNewline:
    enabled: true
  SelfClosingTag:
    enabled: false
  SpaceAroundErbTag:
    enabled: true
  SpaceIndentation:
    enabled: true
  SpaceInHtmlTag:
    enabled: true
  TrailingWhitespace:
    enabled: true
  Rubocop:
    enabled: true
    rubocop_config:
      inherit_from:
        - .rubocop.yml
      Layout/LineLength:
        Enabled: false
      Layout/TrailingEmptyLines:
        Enabled: false
      Lint/UselessAssignment:
        Enabled: false
      Rails/OutputSafety:
        Enabled: false

Unify Ruby and ERB Rubocop rules
Unify Ruby and ERB Rubocop rules

So now we remove duplication between .rubocop.yml and the rubocop rules
defined for erblint. Having the rules in two places led to some
mistakes, like renaming Layout/Tab to Layout/IndentationStyle in
`.rubocop.yml` but forgetting to do so in `.erb-lint.yml`.

This also means we can use the EnforcedStyle options for
Layout/SpaceInsideHashLiteralBraces in views as well.

We couldn't implement this feature earlier because it required Ruby 2.4
and due to incompatibilities between versions of erb_lint and versions
of rubocop.

There are some rules which do not apply to ERB files and so we're
disabling them.

* Layout/LineLength, Layout/TrailingEmptyLines and Lint/UselssAssignment
  generate false positives
* Rails/OutputSafety is redundant since its functionality is already
  covered by ERB Lint ErbSafety linter
