# Last updated to rubocop 0.67.2

AllCops:
  Include:
    - '**/*.arb'
    - '**/*.axlsx'
    - '**/*.builder'
    - '**/*.fcgi'
    - '**/*.gemfile'
    - '**/*.gemspec'
    - '**/*.god'
    - '**/*.jb'
    - '**/*.jbuilder'
    - '**/*.mspec'
    - '**/*.opal'
    - '**/*.pluginspec'
    - '**/*.podspec'
    - '**/*.rabl'
    - '**/*.rake'
    - '**/*.rb'
    - '**/*.rbuild'
    - '**/*.rbw'
    - '**/*.rbx'
    - '**/*.ru'
    - '**/*.ruby'
    - '**/*.spec'
    - '**/*.thor'
    - '**/*.watchr'
    - '**/*Fastfile'
    - '**/.irbrc'
    - '**/.pryrc'
    - '**/Appraisals'
    - '**/Berksfile'
    - '**/Brewfile'
    - '**/Buildfile'
    - '**/Capfile'
    - '**/Cheffile'
    - '**/Dangerfile'
    - '**/Deliverfile'
    - '**/Fastfile'
    - '**/Gemfile'
    - '**/Guardfile'
    - '**/Jarfile'
    - '**/Mavenfile'
    - '**/Podfile'
    - '**/Puppetfile'
    - '**/Rakefile'
    - '**/Snapfile'
    - '**/Thorfile'
    - '**/Vagabondfile'
    - '**/Vagrantfile'
    - '**/buildfile'
    - '**/config.ru'

  Exclude:
    - '**/*.gemspec'
    - '**/admin/**/*.rb'
    - '**/config/deploy.rb'
    - '**/config/unicorn.rb'
    - '**/db/migrate/**/*'
    - '**/db/schema.rb'
    - '**/node_modules/**/*'
    - '**/spec/dummy/**/*'
    - '**/vendor/**/*'
    - '.git/**/*'
    - 'bin/rails'
    - 'bin/rake'
    - 'bin/spring'
    - 'dist/**/*'
    - 'log/**/*'
    - 'tmp/**/*'

  DefaultFormatter:                           'fuubar'
  DisplayCopNames:                            true

################################################################################
#                                 BUNDLER
################################################################################

Bundler/GemComment:
  Enabled:                                    false
  Whitelist:                                  []

Bundler/DuplicatedGem:
  Enabled:                                    true

Bundler/InsecureProtocolSource:
  Enabled:                                    true

Bundler/OrderedGems:
  Enabled:                                    true
  TreatCommentsAsGroupSeparators:             true

################################################################################
#                                 GEMSPEC
################################################################################

Gemspec/DuplicatedAssignment:
  Enabled:                                    true

Gemspec/OrderedDependencies:
  Enabled:                                    true
  TreatCommentsAsGroupSeparators:             true

Gemspec/RequiredRubyVersion:
  Enabled:                                    true

################################################################################
#                                  LAYOUT
################################################################################

Layout/AccessModifierIndentation:
  Enabled:                                    true
  EnforcedStyle:                              'indent'
  IndentationWidth:                           ~

Layout/AlignArray:
  Enabled:                                    true

Layout/AlignHash:
  Enabled:                                    true
  EnforcedHashRocketStyle:                    'table'
  EnforcedColonStyle:                         'table'
  EnforcedLastArgumentHashStyle:              'always_inspect'

Layout/AlignParameters:
  Enabled:                                    true
  EnforcedStyle:                              'with_first_parameter'
  IndentationWidth:                           ~
  Exclude:
    - '**/Gemfile'

Layout/BlockAlignment:
  Enabled:                                    true
  EnforcedStyleAlignWith:                     'either'
  Exclude:
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'
    - 'app/controllers/**/*.rb'

Layout/BlockEndNewline:
  Enabled:                                    true

Layout/CaseIndentation:
  Enabled:                                    true
  EnforcedStyle:                              'end'
  IndentOneStep:                              false
  IndentationWidth:                           ~

Layout/ClassStructure:
  Enabled:                                    true
  ExpectedOrder:
    - 'prepend'
    - 'include'
    - 'extend'
    - 'constants'
    - 'cattr_accessor'
    - 'cattr_reader'
    - 'cattr_writer'
    - 'attr_accessor'
    - 'attr_reader'
    - 'attr_writer'
    - 'delegate'
    - 'serialize'
    - 'belongs_to'
    - 'has_one'
    - 'has_many'
    - 'has_and_belongs_to_many'
    - 'default_scope'
    - 'scope'
    - 'validates'
    - 'validate'
    - 'before_action'
    - 'before_validation'
    - 'after_validation'
    - 'before_save'
    - 'before_create'
    - 'after_action'
    - 'after_create'
    - 'after_save'
    - 'after_commit'
    - 'accepts_nested_attributes_for'
    - 'protect_from_forgery'
    - 'layout'
    - 'friendly_id'
    - 'geocoded_by'
    - 'has_attached_file'
    - 'has_attached_files'
    - 'has_one_attached'
    - 'has_many_attached'
    - 'states'
    - 'state_transitions'
    - 'public_class_methods'
    - 'initializer'
    - 'public_methods'
    - 'protected_methods'
    - 'private_methods'

Layout/ClosingHeredocIndentation:
  Enabled:                                    true

Layout/ClosingParenthesisIndentation:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*_spec.rb'

Layout/CommentIndentation:
  Enabled:                                    true
  Exclude:
    - '**/config/initializers/middleware.rb'

Layout/ConditionPosition:
  Enabled:                                    true

Layout/DefEndAlignment:
  Enabled:                                    true
  EnforcedStyleAlignWith:                     'start_of_line'
  AutoCorrect:                                true

Layout/DotPosition:
  Enabled:                                    true
  EnforcedStyle:                              'leading'

Layout/ElseAlignment:
  Enabled:                                    true

Layout/EmptyComment:
  Enabled:                                    true
  AllowBorderComment:                         true
  AllowMarginComment:                         true

Layout/EmptyLineAfterGuardClause:
  Enabled:                                    true

Layout/EmptyLineAfterMagicComment:
  Enabled:                                    true

Layout/EmptyLineBetweenDefs:
  Enabled:                                    true
  AllowAdjacentOneLineDefs:                   true
  NumberOfEmptyLines:                         1

Layout/EmptyLinesAroundAccessModifier:
  Enabled:                                    true

Layout/EmptyLinesAroundArguments:
  Enabled:                                    true

Layout/EmptyLinesAroundBeginBody:
  Enabled:                                    true

Layout/EmptyLinesAroundBlockBody:
  Enabled:                                    true
  EnforcedStyle:                              'no_empty_lines'
  Exclude:
    - '**/engine.rb'
    - '**/spec/**/*.rb'

Layout/EmptyLinesAroundClassBody:
  Enabled:                                    true
  EnforcedStyle:                              'no_empty_lines'

Layout/EmptyLinesAroundExceptionHandlingKeywords:
  Enabled:                                    true

Layout/EmptyLinesAroundMethodBody:
  Enabled:                                    true

Layout/EmptyLinesAroundModuleBody:
  Enabled:                                    true
  EnforcedStyle:                              'no_empty_lines'

Layout/EmptyLines:
  Enabled:                                    true

Layout/EndAlignment:
  Enabled:                                    true
  EnforcedStyleAlignWith:                     'keyword'
  AutoCorrect:                                true

Layout/EndOfLine:
  Enabled:                                    true
  EnforcedStyle:                              'lf'

Layout/ExtraSpacing:
  Enabled:                                    true
  AllowBeforeTrailingComments:                true
  AllowForAlignment:                          true
  ForceEqualSignAlignment:                    true
  Exclude:
    - '**/Gemfile'
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'

Layout/FirstArrayElementLineBreak:
  Enabled:                                    true

Layout/FirstHashElementLineBreak:
  Enabled:                                    true

Layout/FirstMethodArgumentLineBreak:
  # Disallows: my_method(foo,
  #                      bar)
  Enabled:                                    false

Layout/FirstMethodParameterLineBreak:
  # Disallows: def my_method(foo,
  #                          bar)
  Enabled:                                    false

Layout/FirstParameterIndentation:
  Enabled:                                    true
  EnforcedStyle:                              'consistent_relative_to_receiver'
  IndentationWidth:                           ~
  Exclude:
    - '**/spec/**/*_spec.rb'

Layout/IndentationConsistency:
  Enabled:                                    true
  EnforcedStyle:                              'normal'

Layout/IndentationWidth:
  Enabled:                                    true
  Width:                                      2
  IgnoredPatterns:
    - '^\s*(module|class)'

Layout/IndentArray:
  Enabled:                                    true
  EnforcedStyle:                              'align_brackets'
  IndentationWidth:                           ~

Layout/IndentAssignment:
  Enabled:                                    true
  IndentationWidth:                           ~

Layout/IndentHash:
  Enabled:                                    true
  EnforcedStyle:                              'special_inside_parentheses'
  IndentationWidth:                           ~

Layout/IndentHeredoc:
  Enabled:                                    true
  EnforcedStyle:                              'squiggly'

Layout/InitialIndentation:
  Enabled:                                    true

Layout/LeadingBlankLines:
  Enabled:                                    true

Layout/LeadingCommentSpace:
  Enabled:                                    true

Layout/MultilineArrayBraceLayout:
  Enabled:                                    true
  EnforcedStyle:                              'symmetrical'

Layout/MultilineArrayLineBreaks:
  Enabled:                                    true

Layout/MultilineAssignmentLayout:
  Enabled:                                    true
  EnforcedStyle:                              'same_line'

Layout/MultilineBlockLayout:
  Enabled:                                    true

Layout/MultilineHashBraceLayout:
  Enabled:                                    true
  EnforcedStyle:                              'symmetrical'

Layout/MultilineHashKeyLineBreaks:
  Enabled:                                    true

# https://github.com/rubocop-hq/rubocop/issues/6936
Layout/MultilineMethodArgumentLineBreaks:
  Enabled:                                    false
  Exclude:
    - 'Gemfile'
    - 'config/routes.rb'

Layout/MultilineMethodCallBraceLayout:
  Enabled:                                    true
  EnforcedStyle:                              'symmetrical'

Layout/MultilineMethodCallIndentation:
  Enabled:                                    true
  EnforcedStyle:                              'indented_relative_to_receiver'
  IndentationWidth:                           ~

Layout/MultilineMethodDefinitionBraceLayout:
  Enabled:                                    true
  EnforcedStyle:                              'symmetrical'

Layout/MultilineOperationIndentation:
  # Disallows: @expires_at ||= Time.now.utc +
  #                            60
  Enabled:                                    false

  EnforcedStyle:                              'aligned'
  IndentationWidth:                           ~

Layout/RescueEnsureAlignment:
  Enabled:                                    true

Layout/SpaceAfterColon:
  Enabled:                                    true

Layout/SpaceAfterComma:
  Enabled:                                    true

Layout/SpaceAfterMethodName:
  Enabled:                                    true

Layout/SpaceAfterNot:
  Enabled:                                    true

Layout/SpaceAfterSemicolon:
  Enabled:                                    true

Layout/SpaceAroundBlockParameters:
  Enabled:                                    true
  EnforcedStyleInsidePipes:                   'no_space'

Layout/SpaceAroundEqualsInParameterDefault:
  Enabled:                                    true
  EnforcedStyle:                              'space'

Layout/SpaceAroundKeyword:
  Enabled:                                    true

Layout/SpaceAroundOperators:
  Enabled:                                    true
  AllowForAlignment:                          true

Layout/SpaceBeforeBlockBraces:
  Enabled:                                    true
  EnforcedStyle:                              'space'

Layout/SpaceBeforeComma:
  Enabled:                                    true

Layout/SpaceBeforeComment:
  Enabled:                                    true

Layout/SpaceBeforeFirstArg:
  Enabled:                                    true
  AllowForAlignment:                          true
  Exclude:
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'

Layout/SpaceBeforeSemicolon:
  Enabled:                                    true

Layout/SpaceInLambdaLiteral:
  Enabled:                                    true
  EnforcedStyle:                              'require_no_space'

Layout/SpaceInsideArrayLiteralBrackets:
  Enabled:                                    true
  EnforcedStyle:                              'no_space'
  EnforcedStyleForEmptyBrackets:              'no_space'

Layout/SpaceInsideArrayPercentLiteral:
  Enabled:                                    true

Layout/SpaceInsideBlockBraces:
  Enabled:                                    true
  EnforcedStyle:                              'space'
  EnforcedStyleForEmptyBraces:                'no_space'
  SpaceBeforeBlockParameters:                 true

Layout/SpaceInsideHashLiteralBraces:
  Enabled:                                    true
  EnforcedStyle:                              'space'
  EnforcedStyleForEmptyBraces:                'no_space'

Layout/SpaceInsideParens:
  Enabled:                                    true

Layout/SpaceInsidePercentLiteralDelimiters:
  Enabled:                                    true

Layout/SpaceInsideRangeLiteral:
  Enabled:                                    true

Layout/SpaceInsideReferenceBrackets:
  Enabled:                                    true
  EnforcedStyle:                              'no_space'
  EnforcedStyleForEmptyBrackets:              'no_space'

Layout/SpaceInsideStringInterpolation:
  Enabled:                                    true
  EnforcedStyle:                              'no_space'

Layout/Tab:
  Enabled:                                    true

Layout/TrailingBlankLines:
  Enabled:                                    true
  EnforcedStyle:                              'final_newline'

Layout/TrailingWhitespace:
  Enabled:                                    true

################################################################################
#                                   LINTS
################################################################################

Lint/AmbiguousBlockAssociation:
  Enabled:                                    true
  Exclude:
    - '**/app/models/**/*.rb'
    - '**/spec/**/*_spec.rb'

Lint/AmbiguousOperator:
  Enabled:                                    true

Lint/AmbiguousRegexpLiteral:
  Enabled:                                    true

Lint/AssignmentInCondition:
  Enabled:                                    true
  AllowSafeAssignment:                        true

Lint/BigDecimalNew:
  Enabled:                                    true

Lint/BooleanSymbol:
  Enabled:                                    true

Lint/CircularArgumentReference:
  Enabled:                                    true

Lint/Debugger:
  Enabled:                                    true

Lint/DeprecatedClassMethods:
  Enabled:                                    true

Lint/DisjunctiveAssignmentInConstructor:
  Enabled:                                    true

Lint/DuplicatedKey:
  Enabled:                                    true

Lint/DuplicateMethods:
  Enabled:                                    true

Lint/EachWithObjectArgument:
  Enabled:                                    true

Lint/ElseLayout:
  Enabled:                                    true

Lint/EmptyEnsure:
  Enabled:                                    true

Lint/EmptyInterpolation:
  Enabled:                                    true

Lint/EmptyWhen:
  Enabled:                                    true

Lint/EndInMethod:
  Enabled:                                    true

Lint/EnsureReturn:
  Enabled:                                    true

Lint/ErbNewArguments:
  Enabled:                                    true

Lint/FlipFlop:
  Enabled:                                    true

Lint/FloatOutOfRange:
  Enabled:                                    true

Lint/FormatParameterMismatch:
  Enabled:                                    true

Lint/HandleExceptions:
  Enabled:                                    true

Lint/ImplicitStringConcatenation:
  Enabled:                                    true

Lint/IneffectiveAccessModifier:
  Enabled:                                    true

Lint/InheritException:
  Enabled:                                    true
  EnforcedStyle:                              'standard_error'

Lint/LiteralAsCondition:
  Enabled:                                    true

Lint/LiteralInInterpolation:
  Enabled:                                    true

Lint/Loop:
  Enabled:                                    true

Lint/MissingCopEnableDirective:
  Enabled:                                    true

Lint/MultipleCompare:
  Enabled:                                    true

Lint/NestedMethodDefinition:
  Enabled:                                    true

Lint/NonLocalExitFromIterator:
  Enabled:                                    true

Lint/OrderedMagicComments:
  Enabled:                                    true

Lint/ParenthesesAsGroupedExpression:
  Enabled:                                    true

Lint/PercentStringArray:
  Enabled:                                    true

Lint/PercentSymbolArray:
  Enabled:                                    true

Lint/RandOne:
  Enabled:                                    true

Lint/RedundantWithIndex:
  Enabled:                                    true

Lint/RedundantWithObject:
  Enabled:                                    true

Lint/RequireParentheses:
  Enabled:                                    true

Lint/RescueException:
  Enabled:                                    true

Lint/ReturnInVoidContext:
  Enabled:                                    true

Lint/SafeNavigationChain:
  Enabled:                                    true
  Whitelist:
    - 'present?'
    - 'blank?'
    - 'presence'
    - 'try!'
    - 'try'

Lint/SafeNavigationConsistency:
  Enabled:                                    true

Lint/SafeNavigationWithEmpty:
  Enabled:                                    true

Lint/ScriptPermission:
  Enabled:                                    true

Lint/ShadowedArgument:
  Enabled:                                    true
  IgnoreImplicitReferences:                   false

Lint/ShadowedException:
  Enabled:                                    true

Lint/ShadowingOuterLocalVariable:
  Enabled:                                    true

Lint/StringConversionInInterpolation:
  Enabled:                                    true

Lint/ToJSON:
  Enabled:                                    true

Lint/UnderscorePrefixedVariableName:
  Enabled:                                    true

Lint/UnifiedInteger:
  Enabled:                                    true

Lint/UnneededCopDisableDirective:
  Enabled:                                    true

Lint/UnneededCopEnableDirective:
  Enabled:                                    true

Lint/UnneededRequireStatement:
  Enabled:                                    true

Lint/UnneededSplatExpansion:
  Enabled:                                    true

Lint/UnreachableCode:
  Enabled:                                    true

Lint/UnusedBlockArgument:
  Enabled:                                    true
  AllowUnusedKeywordArguments:                true
  IgnoreEmptyBlocks:                          true

Lint/UnusedMethodArgument:
  Enabled:                                    true
  AllowUnusedKeywordArguments:                true
  IgnoreEmptyMethods:                         true

Lint/UriEscapeUnescape:
  Enabled:                                    true

Lint/UriRegexp:
  Enabled:                                    true

Lint/UselessAccessModifier:
  Enabled:                                    true

Lint/UselessAssignment:
  Enabled:                                    true

Lint/UselessComparison:
  Enabled:                                    true

Lint/UselessElseWithoutRescue:
  Enabled:                                    true

Lint/UselessSetterCall:
  Enabled:                                    true

Lint/Void:
  Enabled:                                    true

################################################################################
#                                 METRICS
################################################################################

Metrics/AbcSize:
  Enabled:                                    true
  Max:                                        25.0
  Exclude:
    - '**/db/sample.rb'

Metrics/BlockNesting:
  Enabled:                                    true
  CountBlocks:                                true
  Max:                                        3
  Exclude:
    - '**/*.rake'
    - '**/config/routes.rb'
    - '**/db/sample.rb'
    - '**/refinements/*.rb'
    - '**/spec/**/*_spec.rb'
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'
    - 'Rakefile'

Metrics/BlockLength:
  CountComments:                              false
  Max:                                        25
  Exclude:
    - '**/*.rake'
    - '**/config/routes.rb'
    - '**/db/sample.rb'
    - '**/db/scrub.rb'
    - '**/db/seed.rb'
    - '**/refinements/*.rb'
    - '**/spec/**/*_spec.rb'
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'
    - '**/spec/shared/**/*.rb'
    - '**/spec/support/**/*.rb'
    - 'Rakefile'
  ExcludedMethods:
    - 'namespace'
    - 'draw'
    - 'context'
    - 'describe'
    - 'refine'
    - 'shared_examples'
    - 'shared_examples_for'

Metrics/ClassLength:
  Enabled:                                    true
  CountComments:                              false
  Max:                                        200
  Exclude:
    - '**/spec/**/*_spec.rb'

Metrics/ModuleLength:
  Enabled:                                    true
  CountComments:                              false
  Max:                                        200
  Exclude:
    - '**/spec/**/*_spec.rb'

Metrics/CyclomaticComplexity:
  Enabled:                                    true
  Max:                                        6

# yamllint disable rule:line-length
Metrics/LineLength:
  Enabled:                                    true
  Max:                                        90
  AllowHeredoc:                               true
  AllowURI:                                   true
  IgnoreCopDirectives:                        true
  IgnoredPatterns:
    - "\\s+raise_error\\([^)]+\\)$"                                             # raise_error(LongClassName)
    - "^(\\s+|.*)'[^']+'\\s+=\\>\\s+'[^']+',$"                                  # 'foo' => 'really_long_string',
    - "^(\\s+|.*)'[^']+'\\s+=\\>\\s+\\\"[^\\\"]+\\\",$"                         # 'foo' => "really_long_string",
    - "^(\\s+|.*)'[^']+'\\s+=\\>\\s+match\\(.*\\),"                             # 'foo' => match(/really_long_regex/),
    - "^(\\s+|.*):[\\w_]+\\s+=\\>\\s+'[^']+',$"                                 # :foo => 'really_long_string',
    - "^(\\s+|.*):[\\w_]+\\s+=\\>\\s+\\\"[^\\\"]+\\\",$"                        # :foo => "really_long_string",
    - "^(\\s+|.*)[\\w_]+:\\s+'[^']+',$"                                         # foo: 'really_long_string',
    - "^(\\s+|.*)[\\w_]+:\\s+\\\"[^\\\"]+\\\",$"                                # foo: "really_long_string",
    - "^\\s*(fail|raise)\\s+"                                                   # fail or raise an exception
    - "^\\s*class\\s+"                                                          # class definition with really long inherited class
    - "^\\s*require\\s+'[^']+'$"                                                # require 'some_really_long_path_name'
    - "^\\s+expect\\([^\\)]+\\)+\\.(not_)?to\\s+[^\\s]+\\s+%[qQ]{[^}]+}$"       # RSpec expectation line for a string with %q syntax
    - "^\\s+expect\\([^\\)]+\\)+\\.(not_)?to\\s+[^\\s]+\\s+'[^']+'$"            # RSpec expectation line for a single-quoted string
    - "^\\s+expect\\([^\\)]+\\)+\\.(not_)?to\\s+[^\\s]+\\s+Time\\.(new|utc).*"  # RSpec expectation line for a Time
    - "^\\s+expect\\([^\\)]+\\)+\\.(not_)?to\\s+[^\\s]+\\s+\\\"[^\\\"]+\\\"$"   # RSpec expectation line for a double-quoted string
    - "^\\s+return\\s+.*(if|unless)"                                            # Short circuiting returns
    - '^\s*((private|public|protected)\s+)?def\s+[\w\._]+\(?'                   # Method definitions
    - '^\s+belongs_to\s+.*'                                                     # Rails belongs_to relationships
    - '^\s+broadcast[\s\\(].*'                                                  # Wisper Broadcasts
    - '^\s+context\s+.*'                                                        # RSpec context lines
    - '^\s+describe\s+.*'                                                       # RSpec describe lines
    - '^\s+expose\(:[\w_]+\)\s+\{.*'                                            # Controller exposures
    - '^\s+factory\s+.*'                                                        # FactoryBot factory definitions
    - '^\s+has_many\s+.*'                                                       # Rails has_many relationships
    - '^\s+has_one\s+.*'                                                        # Rails has_one relationships
    - '^\s+it\s+.*'                                                             # RSpec it lines
    - '^\s+let\(:[\w_]+\)\s+\{.*'                                               # RSpec lets on single line
    - '^\s+scope\s+.*'                                                          # Rails scopes
  URISchemes:
    - 'http'
    - 'https'
  Exclude:
    - '**/Gemfile'
    - '**/config/environments/**/*'
    - '**/config/initializers/**/*'
    - '**/config/routes.rb'
    - '**/db/sample.rb'
    - '**/db/scrub.rb'
    - '**/db/seed.rb'
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'
# yamllint enable rule:line-length

Metrics/MethodLength:
  Enabled:                                    true
  CountComments:                              false
  Max:                                        30
  ExcludedMethods:                            []
  Exclude:
    - '**/db/sample.rb'
    - '**/db/scrub.rb'
    - '**/db/seed.rb'

Metrics/ParameterLists:
  Enabled:                                    true
  Max:                                        5
  CountKeywordArgs:                           true

Metrics/PerceivedComplexity:
  Enabled:                                    true
  Max:                                        7

################################################################################
#                                  NAMING
################################################################################

Naming/AccessorMethodName:
  Enabled:                                    true

Naming/AsciiIdentifiers:
  Enabled:                                    true

Naming/BinaryOperatorParameterName:
  Enabled:                                    true

Naming/ClassAndModuleCamelCase:
  Enabled:                                    true

Naming/ConstantName:
  Enabled:                                    true

Naming/FileName:
  Enabled:                                    true
  IgnoreExecutableScripts:                    true
  ExpectMatchingDefinition:                   false
  Exclude:
    - '**/Rakefile'
    - '**/Gemfile'
    - '**/Capfile'
    - '**/Vagrantfile'
    - '**/Podfile'
    - '**/Thorfile'

Naming/HeredocDelimiterNaming:
  Enabled:                                    true
  Blacklist:
    - 'END'
    - !ruby/regexp '/EO[A-Z]{1}/'

Naming/HeredocDelimiterCase:
  Enabled:                                    true
  EnforcedStyle:                              'uppercase'

Naming/MemoizedInstanceVariableName:
  Enabled:                                    true
  EnforcedStyleForLeadingUnderscores:         'disallowed'

Naming/MethodName:
  Enabled:                                    true
  EnforcedStyle:                              'snake_case'

Naming/PredicateName:
  Enabled:                                    true
  NamePrefix:
    - 'is_'
    - 'was_'
    - 'has_'
    - 'have_'
  NamePrefixBlacklist:
    - 'is_'
    - 'was_'
    - 'have_'
  NameWhitelist:
    - 'is_a?'
  MethodDefinitionMacros:
    - 'define_method'
    - 'define_singleton_method'
  Exclude:
    - '**/spec/**/*.rb'

Naming/RescuedExceptionsVariableName:
  Enabled:                                    true
  PreferredName:                              'error'

Naming/UncommunicativeBlockParamName:
  Enabled:                                    true
  MinNameLength:                              1
  AllowNamesEndingInNumbers:                  true
  AllowedNames:                               []
  ForbiddenNames:                             []

Naming/UncommunicativeMethodParamName:
  Enabled:                                    true
  MinNameLength:                              3
  AllowNamesEndingInNumbers:                  true
  AllowedNames:
    - 'at'
    - 'by'
    - 'db'
    - 'id'
    - 'in'
    - 'io'
    - 'ip'
    - 'on'
    - 'to'
  ForbiddenNames:                             []

Naming/VariableName:
  Enabled:                                    true
  EnforcedStyle:                              'snake_case'

Naming/VariableNumber:
  Enabled:                                    true
  EnforcedStyle:                              'snake_case'

################################################################################
#                                PERFORMANCE
################################################################################

Performance/Caller:
  Enabled:                                    true

Performance/Casecmp:
  Enabled:                                    true

Performance/CaseWhenSplat:
  Enabled:                                    true

Performance/ChainArrayAllocation:
  Enabled:                                    true

Performance/CompareWithBlock:
  Enabled:                                    true

Performance/Count:
  Enabled:                                    true

Performance/Detect:
  Enabled:                                    true

Performance/DoubleStartEndWith:
  Enabled:                                    true
  IncludeActiveSupportAliases:                true

Performance/EndWith:
  Enabled:                                    true

Performance/FixedSize:
  Enabled:                                    true

Performance/FlatMap:
  Enabled:                                    true

Performance/InefficientHashSearch:
  Enabled:                                    true

Performance/OpenStruct:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*.rb'

Performance/RangeInclude:
  Enabled:                                    true

Performance/RedundantBlockCall:
  Enabled:                                    true

Performance/RedundantMatch:
  Enabled:                                    true

Performance/RedundantMerge:
  Enabled:                                    true

Performance/RegexpMatch:
  Enabled:                                    true

Performance/ReverseEach:
  Enabled:                                    true

Performance/Size:
  Enabled:                                    true

Performance/StartWith:
  Enabled:                                    true

Performance/StringReplacement:
  Enabled:                                    true

Performance/TimesMap:
  Enabled:                                    true
  AutoCorrect:                                true

Performance/UnfreezeString:
  Enabled:                                    true

Performance/UriDefaultParser:
  Enabled:                                    true

################################################################################
#                                  SECURITY
################################################################################

Security/Eval:
  Enabled:                                    true

Security/JSONLoad:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*.rb'

Security/Open:
  Enabled:                                    true

Security/YAMLLoad:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*.rb'

Security/MarshalLoad:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*.rb'

################################################################################
#                                  STYLE
################################################################################

Style/AccessModifierDeclarations:
  Enabled:                                    true
  EnforcedStyle:                              'group'

Style/Alias:
  Enabled:                                    true
  EnforcedStyle:                              'prefer_alias'

Style/AndOr:
  Enabled:                                    true
  EnforcedStyle:                              'always'

Style/ArrayJoin:
  Enabled:                                    true

Style/AsciiComments:
  Enabled:                                    true
  AllowedChars:                               []

Style/Attr:
  Enabled:                                    true

Style/AutoResourceCleanup:
  Enabled:                                    true

Style/BarePercentLiterals:
  Enabled:                                    true
  EnforcedStyle:                              'percent_q'

Style/BeginBlock:
  Enabled:                                    true

Style/BlockComments:
  Enabled:                                    true

Style/BlockDelimiters:
  Enabled:                                    true
  EnforcedStyle:                              'braces_for_chaining'
  AllowBracesOnProceduralOneLiners:           true
  Exclude:
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'
    - 'app/controllers/**/*.rb'

Style/BracesAroundHashParameters:
  Enabled:                                    true
  EnforcedStyle:                              'context_dependent'

Style/CaseEquality:
  Enabled:                                    true

Style/CharacterLiteral:
  Enabled:                                    true

Style/ClassAndModuleChildren:
  Enabled:                                    true
  EnforcedStyle:                              'nested'

Style/ClassCheck:
  Enabled:                                    true
  EnforcedStyle:                              'is_a?'

Style/ClassMethods:
  Enabled:                                    true

Style/ClassVars:
  Enabled:                                    true

Style/CollectionMethods:
  Enabled:                                    true
  PreferredMethods:
    collect:                                  'map'
    collect!:                                 'map!'
    reduce:                                   'inject'
    detect:                                   'find'
    find_all:                                 'select'

Style/ColonMethodCall:
  Enabled:                                    true

Style/ColonMethodDefinition:
  Enabled:                                    true

Style/CommandLiteral:
  Enabled:                                    true
  EnforcedStyle:                              'backticks'
  AllowInnerBackticks:                        false

Style/CommentAnnotation:
  Enabled:                                    true
  Keywords:
    - 'TODO'
    - 'FIXME'
    - 'OPTIMIZE'
    - 'HACK'
    - 'REVIEW'

Style/CommentedKeyword:
  Enabled:                                    true
  Exclude:
    - '**/Gemfile'

Style/ConditionalAssignment:
  Enabled:                                    true
  EnforcedStyle:                              'assign_to_condition'
  IncludeTernaryExpressions:                  true
  SingleLineConditionsOnly:                   false

Style/ConstantVisibility:
  Enabled:                                    true

Style/Copyright:
  # Copyrights at the Top of Files are Noisy
  Enabled:                                    false

Style/DefWithParentheses:
  Enabled:                                    true

Style/Dir:
  Enabled:                                    true

Style/Documentation:
  # Use Some Other Tool Like `inch` to Enforce This
  Enabled:                                    false

Style/DocumentationMethod:
  RequireForNonPublicMethods:                 false

Style/DoubleNegation:
  Enabled:                                    true

Style/EachForSimpleLoop:
  Enabled:                                    true

Style/EachWithObject:
  Enabled:                                    true

Style/EmptyBlockParameter:
  Enabled:                                    true

Style/EmptyCaseCondition:
  Enabled:                                    true

Style/EmptyElse:
  Enabled:                                    true
  EnforcedStyle:                              'both'

Style/EmptyLiteral:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'

Style/EmptyMethod:
  Enabled:                                    true
  EnforcedStyle:                              'compact'

Style/Encoding:
  Enabled:                                    true

Style/EndBlock:
  Enabled:                                    true

Style/ExpandPathArguments:
  Enabled:                                    true

Style/EvalWithLocation:
  Enabled:                                    true

Style/EvenOdd:
  Enabled:                                    true

Style/For:
  Enabled:                                    true
  EnforcedStyle:                              'each'

Style/FormatString:
  Enabled:                                    true
  EnforcedStyle:                              'percent'

Style/FormatStringToken:
  Enabled:                                    true
  EnforcedStyle:                              'annotated'

Style/FrozenStringLiteralComment:
  Enabled:                                    true

Style/GlobalVars:
  Enabled:                                    true
  AllowedVariables:                           []

Style/GuardClause:
  Enabled:                                    true
  MinBodyLength:                              1

Style/HashSyntax:
  Enabled:                                    true
  EnforcedStyle:                              'ruby19'
  UseHashRocketsWithSymbolValues:             false
  PreferHashRocketsForNonAlnumEndingSymbols:  true

Style/IdenticalConditionalBranches:
  Enabled:                                    true

Style/IfInsideElse:
  Enabled:                                    true

Style/IfUnlessModifier:
  Enabled:                                    true
  Exclude:
    - '**/config/initializers/*.rb'

Style/IfUnlessModifierOfIfUnless:
  Enabled:                                    true

Style/IfWithSemicolon:
  Enabled:                                    true

Style/ImplicitRuntimeError:
  Enabled:                                    true

Style/InfiniteLoop:
  Enabled:                                    true

Style/InlineComment:
  Enabled:                                    true
  Exclude:
    - '**/Gemfile'
    - '**/config/boot.rb'
    - '**/config/initializers/*.rb'

Style/InverseMethods:
  Enabled:                                    true
  InverseMethods:
    :any?:     :none?
    :even?:    :odd?
    :==:       :!=
    :=~:       :!~
    :<:        :>=
    :>:        :<=
    :present?: :blank?,
    :include?: :exclude?
  InverseBlocks:
    :select:   :reject
    :select!:  :reject!

Style/IpAddresses:
  Enabled:                                    true
  Whitelist:
    - '::'
  Exclude:
    - '**/spec/**/*_spec.rb'
    - '**/spec/**/factories/**/*.rb'
    - '**/spec/factories.rb'

Style/Lambda:
  Enabled:                                    true

Style/LambdaCall:
  Enabled:                                    true
  EnforcedStyle:                              'call'

Style/LineEndConcatenation:
  Enabled:                                    true

Style/MethodCalledOnDoEndBlock:
  Enabled:                                    true

Style/MethodCallWithArgsParentheses:
  # Would Require a *lot* of Effort Adding Ignored Methods
  Enabled:                                    false
  AllowParenthesesInMultilineCall:            true
  AllowParenthesesInChaining:                 true
  AllowParenthesesInCamelCaseMethod:          true
  IgnoreMacros:                               true
  IgnoredMethods:
    - 'puts'

Style/MethodCallWithoutArgsParentheses:
  Enabled:                                    true
  IgnoredMethods:                             []

Style/MethodDefParentheses:
  Enabled:                                    true
  EnforcedStyle:                              'require_parentheses'

Style/MethodMissingSuper:
  Enabled:                                    true

Style/MinMax:
  Enabled:                                    true

Style/MissingElse:
  # Decent Idea But Too Many Use Cases for `if` Without `else`
  Enabled:                                    false
  EnforcedStyle:                              'both'
  SupportedStyles:
    - 'if'
    - 'case'
    - 'both'

Style/MissingRespondToMissing:
  Enabled:                                    true

Style/MixinGrouping:
  Enabled:                                    true
  EnforcedStyle:                              'separated'
  Exclude:
    - '**/spec/**/*_spec.rb'

Style/MixinUsage:
  Enabled:                                    true

Style/ModuleFunction:
  Enabled:                                    true
  EnforcedStyle:                              'module_function'

Style/MultilineBlockChain:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*_spec.rb'

Style/MultilineIfModifier:
  Enabled:                                    true

Style/MultilineIfThen:
  Enabled:                                    true

Style/MultilineMemoization:
  Enabled:                                    true
  EnforcedStyle:                              'keyword'

Style/MultilineMethodSignature:
  # Disallows: my_method(foo,
  #                      bar)
  Enabled:                                    false

Style/MultilineTernaryOperator:
  Enabled:                                    true

Style/MultipleComparison:
  Enabled:                                    true

Style/MutableConstant:
  Enabled:                                    true

Style/NegatedIf:
  Enabled:                                    true
  EnforcedStyle:                              'both'

Style/NegatedWhile:
  Enabled:                                    true

Style/NestedModifier:
  Enabled:                                    true

Style/NestedParenthesizedCalls:
  Enabled:                                    true
  Whitelist:
    - 'be'
    - 'be_a'
    - 'be_an'
    - 'be_between'
    - 'be_falsey'
    - 'be_kind_of'
    - 'be_instance_of'
    - 'be_truthy'
    - 'be_within'
    - 'eq'
    - 'eql'
    - 'end_with'
    - 'include'
    - 'match'
    - 'raise_error'
    - 'respond_to'
    - 'start_with'

Style/NestedTernaryOperator:
  Enabled:                                    true

Style/Next:
  Enabled:                                    true
  EnforcedStyle:                              'skip_modifier_ifs'
  MinBodyLength:                              3

Style/NilComparison:
  Enabled:                                    true
  EnforcedStyle:                              'predicate'

Style/NonNilCheck:
  Enabled:                                    true
  IncludeSemanticChanges:                     false

Style/Not:
  Enabled:                                    true

Style/NumericLiteralPrefix:
  Enabled:                                    true
  EnforcedOctalStyle:                         'zero_with_o'

Style/NumericLiterals:
  Enabled:                                    true
  MinDigits:                                  5
  Strict:                                     false

Style/NumericPredicate:
  Enabled:                                    true
  EnforcedStyle:                              'predicate'
  IgnoredMethods:                             []
  Exclude:
    - '**/spec/**/*_spec.rb'

Style/OneLineConditional:
  Enabled:                                    true

Style/OptionalArguments:
  Enabled:                                    true

Style/OptionHash:
  Enabled:                                    true
  Exclude:
    - '**/workers/**/*.rb'
    - '**/jobs/**/*.rb'
  SuspiciousParamNames:
    - 'options'
    - 'opts'
    - 'args'
    - 'params'
    - 'parameters'

Style/OrAssignment:
  Enabled:                                    true

Style/ParallelAssignment:
  Enabled:                                    true

Style/ParenthesesAroundCondition:
  Enabled:                                    true
  AllowSafeAssignment:                        true
  AllowInMultilineConditions:                 false

Style/PercentLiteralDelimiters:
  Enabled:                                    true
  PreferredDelimiters:
    '%':                                      '{}'
    '%i':                                     '{}'
    '%I':                                     '{}'
    '%q':                                     '{}'
    '%Q':                                     '{}'
    '%r':                                     '{}'
    '%s':                                     '{}'
    '%w':                                     '{}'
    '%W':                                     '{}'
    '%x':                                     '{}'

Style/PercentQLiterals:
  Enabled:                                    true
  EnforcedStyle:                              'upper_case_q'

Style/PerlBackrefs:
  Enabled:                                    true

Style/PreferredHashMethods:
  Enabled:                                    true
  EnforcedStyle:                              'verbose'

Style/Proc:
  Enabled:                                    true

Style/RaiseArgs:
  Enabled:                                    true
  EnforcedStyle:                              'exploded'

Style/RandomWithOffset:
  Enabled:                                    true

Style/RedundantBegin:
  Enabled:                                    true

Style/RedundantConditional:
  Enabled:                                    true

Style/RedundantException:
  Enabled:                                    true

Style/RedundantFreeze:
  Enabled:                                    true

Style/RedundantParentheses:
  Enabled:                                    true

Style/RedundantReturn:
  Enabled:                                    true
  AllowMultipleReturnValues:                  true

Style/RedundantSelf:
  Enabled:                                    true

Style/RedundantSortBy:
  Enabled:                                    true

Style/RegexpLiteral:
  Enabled:                                    true
  EnforcedStyle:                              'slashes'
  AllowInnerSlashes:                          false

Style/RescueModifier:
  Enabled:                                    true

Style/RescueStandardError:
  Enabled:                                    true

Style/ReturnNil:
  Enabled:                                    true
  EnforcedStyle:                              'return'

Style/SafeNavigation:
  Enabled:                                    true
  ConvertCodeThatCanStartToReturnNil:         false
  Whitelist:
    - 'blank?'
    - 'presence'
    - 'present?'
    - 'try!'
    - 'try'

Style/Sample:
  Enabled:                                    true

Style/SelfAssignment:
  Enabled:                                    true

Style/Semicolon:
  Enabled:                                    true
  AllowAsExpressionSeparator:                 false

Style/Send:
  Enabled:                                    true
  Exclude:
    - '**/spec/**/*_spec.rb'

Style/SignalException:
  Enabled:                                    true
  EnforcedStyle:                              'semantic'

Style/SingleLineBlockParams:
  Enabled:                                    true
  Methods:
    - reduce:
        - 'm'
        - 'v'
    - inject:
        - 'm'
        - 'v'

Style/SingleLineMethods:
  Enabled:                                    true
  AllowIfMethodIsEmpty:                       true
  Exclude:
    - 'app/models/**/*.rb'

Style/SpecialGlobalVars:
  Enabled:                                    true
  EnforcedStyle:                              'use_english_names'

Style/StabbyLambdaParentheses:
  Enabled:                                    true
  EnforcedStyle:                              'require_parentheses'

Style/StderrPuts:
  Enabled:                                    true

Style/StringHashKeys:
  Enabled:                                    false # Requires Symbolized Hash Keys

Style/StringLiterals:
  Enabled:                                    true
  EnforcedStyle:                              'single_quotes'
  ConsistentQuotesInMultiline:                true

Style/StringLiteralsInInterpolation:
  Enabled:                                    true

Style/StringMethods:
  Enabled:                                    true
  PreferredMethods:
    intern: 'to_sym'

Style/Strip:
  Enabled:                                    true

Style/StructInheritance:
  Enabled:                                    true

Style/SymbolArray:
  Enabled:                                    true
  EnforcedStyle:                              'percent'
  MinSize:                                    0

Style/SymbolLiteral:
  Enabled:                                    true

Style/SymbolProc:
  Enabled:                                    true
  IgnoredMethods:
    - 'respond_to'
    - 'define_method'

Style/TernaryParentheses:
  Enabled:                                    true
  AllowSafeAssignment:                        true
  EnforcedStyle:                              'require_parentheses_when_complex'

Style/TrailingBodyOnClass:
  Enabled:                                    true

Style/TrailingBodyOnMethodDefinition:
  Enabled:                                    true

Style/TrailingBodyOnModule:
  Enabled:                                    true

Style/TrailingCommaInArguments:
  Enabled:                                    true
  EnforcedStyleForMultiline:                  'comma'

Style/TrailingCommaInArrayLiteral:
  Enabled:                                    true
  EnforcedStyleForMultiline:                  'comma'

Style/TrailingCommaInHashLiteral:
  Enabled:                                    true
  EnforcedStyleForMultiline:                  'comma'

Style/TrailingMethodEndStatement:
  Enabled:                                    true

Style/TrailingUnderscoreVariable:
  Enabled:                                    true
  AllowNamedUnderscoreVariables:              true

Style/TrivialAccessors:
  Enabled:                                    true
  AllowPredicates:                            false

Style/UnlessElse:
  Enabled:                                    true

Style/UnneededCapitalW:
  Enabled:                                    true

Style/UnneededCondition:
  Enabled:                                    true

Style/UnneededInterpolation:
  Enabled:                                    true

Style/UnneededPercentQ:
  Enabled:                                    true

Style/UnpackFirst:
  Enabled:                                    true

Style/VariableInterpolation:
  Enabled:                                    true

Style/WhenThen:
  Enabled:                                    true

Style/WhileUntilDo:
  Enabled:                                    true

Style/WhileUntilModifier:
  Enabled:                                    true

Style/WordArray:
  Enabled:                                    true
  EnforcedStyle:                              'percent'
  MinSize:                                    0

Style/YodaCondition:
  Enabled:                                    true
  EnforcedStyle:                              'forbid_for_all_comparison_operators'

Style/ZeroLengthPredicate:
  Enabled:                                    true
