This way we make sure we won't add `html_safe` or `raw` calls in the future. I'm excluding `text_with_links_helpers` for this check, because in this situation the use of `html_safe` is justified: we check the original input is safe, and we're only adding link tags to raw URLs.
267 lines
4.1 KiB
YAML
267 lines
4.1 KiB
YAML
require:
|
|
- rubocop-performance
|
|
- rubocop-rails
|
|
- rubocop-rspec
|
|
|
|
AllCops:
|
|
DisplayCopNames: true
|
|
DisplayStyleGuide: true
|
|
Exclude:
|
|
- "db/migrate/**/*"
|
|
- "db/schema.rb"
|
|
TargetRubyVersion: 2.3
|
|
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
|
DisabledByDefault: true
|
|
|
|
Bundler/DuplicatedGem:
|
|
Enabled: true
|
|
|
|
Bundler/OrderedGems:
|
|
Enabled: true
|
|
|
|
Capybara/CurrentPathExpectation:
|
|
Enabled: true
|
|
|
|
Capybara/FeatureMethods:
|
|
Enabled: true
|
|
EnabledMethods:
|
|
- scenario
|
|
- xscenario
|
|
|
|
FactoryBot/AttributeDefinedStatically:
|
|
Enabled: true
|
|
|
|
Layout/IndentationConsistency:
|
|
EnforcedStyle: indented_internal_methods
|
|
|
|
Layout/IndentationWidth:
|
|
Enabled: true
|
|
|
|
Layout/EmptyLines:
|
|
Enabled: true
|
|
|
|
Layout/EndOfLine:
|
|
EnforcedStyle: lf
|
|
|
|
Layout/MultilineBlockLayout:
|
|
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
|
|
|
|
Layout/SpaceAroundOperators:
|
|
Enabled: true
|
|
|
|
Layout/SpaceBeforeBlockBraces:
|
|
Enabled: true
|
|
|
|
Layout/SpaceBeforeComma:
|
|
Enabled: true
|
|
|
|
Layout/SpaceBeforeComment:
|
|
Enabled: true
|
|
|
|
Layout/SpaceBeforeFirstArg:
|
|
Enabled: true
|
|
|
|
Layout/SpaceBeforeSemicolon:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideArrayLiteralBrackets:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideArrayPercentLiteral:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideBlockBraces:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideHashLiteralBraces:
|
|
Enabled: true
|
|
EnforcedStyle: compact
|
|
|
|
Layout/SpaceInsideParens:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsidePercentLiteralDelimiters:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideRangeLiteral:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideReferenceBrackets:
|
|
Enabled: true
|
|
|
|
Layout/SpaceInsideStringInterpolation:
|
|
Enabled: true
|
|
|
|
Layout/Tab:
|
|
Enabled: true
|
|
|
|
Layout/TrailingBlankLines:
|
|
Enabled: true
|
|
|
|
Layout/TrailingWhitespace:
|
|
Enabled: true
|
|
|
|
Lint/AmbiguousRegexpLiteral:
|
|
Enabled: true
|
|
|
|
Lint/DuplicateMethods:
|
|
Enabled: true
|
|
|
|
Lint/LiteralAsCondition:
|
|
Enabled: true
|
|
|
|
Lint/ParenthesesAsGroupedExpression:
|
|
Enabled: true
|
|
|
|
Lint/ShadowingOuterLocalVariable:
|
|
Enabled: true
|
|
|
|
Lint/StringConversionInInterpolation:
|
|
Enabled: true
|
|
|
|
Lint/UselessAssignment:
|
|
Enabled: true
|
|
|
|
Metrics/LineLength:
|
|
Max: 110
|
|
Severity: refactor
|
|
|
|
Rails/ActionFilter:
|
|
Enabled: true
|
|
|
|
Rails/ApplicationJob:
|
|
Enabled: true
|
|
|
|
Rails/ApplicationRecord:
|
|
Enabled: true
|
|
|
|
Rails/Date:
|
|
Enabled: true
|
|
|
|
Rails/HttpPositionalArguments:
|
|
Enabled: true
|
|
|
|
Rails/OutputSafety:
|
|
Enabled: true
|
|
Severity: warning
|
|
Exclude:
|
|
- app/helpers/text_with_links_helper.rb
|
|
|
|
Rails/PluralizationGrammar:
|
|
Enabled: true
|
|
|
|
Rails/Presence:
|
|
Enabled: true
|
|
|
|
Rails/RelativeDateConstant:
|
|
Enabled: true
|
|
|
|
Rails/RequestReferer:
|
|
Enabled: true
|
|
|
|
Rails/SafeNavigation:
|
|
Enabled: true
|
|
ConvertTry: true
|
|
|
|
Rails/TimeZone:
|
|
Enabled: true
|
|
|
|
Rails/UnknownEnv:
|
|
Enabled: true
|
|
Environments:
|
|
- development
|
|
- test
|
|
- production
|
|
- preproduction
|
|
- staging
|
|
|
|
Rails/Validation:
|
|
Enabled: true
|
|
|
|
RSpec/AroundBlock:
|
|
Enabled: true
|
|
|
|
RSpec/BeforeAfterAll:
|
|
Enabled: true
|
|
|
|
RSpec/DescribedClass:
|
|
Enabled: true
|
|
EnforcedStyle: explicit
|
|
|
|
RSpec/EmptyExampleGroup:
|
|
Enabled: true
|
|
Exclude:
|
|
- spec/factories/**/*
|
|
|
|
RSpec/EmptyLineAfterExampleGroup:
|
|
Enabled: true
|
|
Exclude:
|
|
- spec/factories/**/*
|
|
|
|
RSpec/ExampleWording:
|
|
Enabled: true
|
|
|
|
RSpec/Focus:
|
|
Enabled: true
|
|
|
|
RSpec/HookArgument:
|
|
Enabled: true
|
|
|
|
RSpec/InstanceVariable:
|
|
Enabled: true
|
|
Exclude:
|
|
- spec/controllers/concerns/has_filters_spec.rb
|
|
- spec/controllers/concerns/has_orders_spec.rb
|
|
|
|
RSpec/LetBeforeExamples:
|
|
Enabled: true
|
|
|
|
RSpec/LetSetup:
|
|
Enabled: true
|
|
|
|
RSpec/NotToNot:
|
|
Enabled: true
|
|
|
|
RSpec/OverwritingSetup:
|
|
Enabled: true
|
|
|
|
RSpec/RepeatedExample:
|
|
Enabled: true
|
|
|
|
RSpec/ScatteredLet:
|
|
Enabled: true
|
|
|
|
RSpec/ScatteredSetup:
|
|
Enabled: true
|
|
|
|
RSpec/VoidExpect:
|
|
Enabled: true
|
|
|
|
Style/BlockDelimiters:
|
|
Enabled: true
|
|
|
|
Style/PercentLiteralDelimiters:
|
|
Enabled: true
|
|
|
|
Style/StringLiterals:
|
|
EnforcedStyle: double_quotes
|