2015-04-05 08:49:25 +08:00
|
|
|
require:
|
|
|
|
- rubocop-rspec
|
|
|
|
# this odd relative path is so that rubocop works when run without "bundle
|
|
|
|
# exec", such as from most editors/IDEs.
|
|
|
|
- ./gems/rubocop-canvas/lib/rubocop_canvas
|
|
|
|
|
2017-01-04 08:52:49 +08:00
|
|
|
AllCops:
|
|
|
|
TargetRubyVersion: 2.3
|
|
|
|
|
2015-04-05 08:49:25 +08:00
|
|
|
# our style changes: disabling style rules we aren't interested in
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/AlignParameters:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2018-02-13 02:55:16 +08:00
|
|
|
Layout/ElseAlignment:
|
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLines:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLinesAroundAccessModifier:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLinesAroundArguments:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLinesAroundBlockBody:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLinesAroundClassBody:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLinesAroundMethodBody:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/EmptyLinesAroundModuleBody:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/IndentHash:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/IndentationConsistency:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/IndentationWidth:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/MultilineOperationIndentation:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceAfterColon:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceAfterComma:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceAroundEqualsInParameterDefault:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceAroundOperators:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceBeforeBlockBraces:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceBeforeFirstArg:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceInLambdaLiteral:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceInsideArrayLiteralBrackets:
|
2015-04-10 03:55:31 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceInsideBlockBraces:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Layout/SpaceInsideHashLiteralBraces:
|
|
|
|
Enabled: false
|
|
|
|
Layout/SpaceInsideReferenceBrackets:
|
|
|
|
Enabled: false
|
|
|
|
Layout/TrailingBlankLines:
|
|
|
|
Enabled: false
|
|
|
|
Layout/TrailingWhitespace:
|
|
|
|
Enabled: false
|
|
|
|
|
2018-03-03 03:36:50 +08:00
|
|
|
Style/FormatStringToken:
|
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Style/StringLiterals:
|
|
|
|
Enabled: false
|
|
|
|
Style/SignalException:
|
|
|
|
Enabled: false
|
|
|
|
Style/NumericLiterals:
|
|
|
|
Enabled: false
|
|
|
|
Style/BracesAroundHashParameters:
|
|
|
|
Enabled: false
|
|
|
|
Style/PercentLiteralDelimiters:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Style/Documentation:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Style/ClassAndModuleChildren:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Style/RegexpLiteral:
|
|
|
|
Enabled: false
|
|
|
|
Style/GuardClause:
|
|
|
|
Enabled: false
|
|
|
|
Style/RedundantSelf:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
|
|
|
Style/IfUnlessModifier:
|
|
|
|
Enabled: false
|
|
|
|
Style/WordArray:
|
|
|
|
Enabled: false
|
|
|
|
Style/PercentQLiterals:
|
|
|
|
Enabled: false
|
2015-04-10 03:55:31 +08:00
|
|
|
Style/DoubleNegation:
|
|
|
|
Enabled: false
|
2016-12-28 14:17:05 +08:00
|
|
|
Style/TrailingCommaInArguments:
|
|
|
|
Enabled: false
|
|
|
|
Style/TrailingCommaInLiteral:
|
2015-04-10 03:55:31 +08:00
|
|
|
Enabled: false
|
2017-02-01 02:26:34 +08:00
|
|
|
Style/MethodCallWithoutArgsParentheses:
|
|
|
|
Enabled: false
|
|
|
|
Style/MethodCallWithArgsParentheses:
|
2015-04-10 03:55:31 +08:00
|
|
|
Enabled: false
|
2018-01-03 01:29:58 +08:00
|
|
|
Layout/DotPosition:
|
2017-11-17 02:15:36 +08:00
|
|
|
Enabled: true
|
|
|
|
EnforcedStyle: trailing
|
2018-01-03 01:29:58 +08:00
|
|
|
Layout/AlignHash:
|
2015-04-16 04:49:06 +08:00
|
|
|
Enabled: false
|
2015-04-28 00:23:45 +08:00
|
|
|
Style/Lambda:
|
|
|
|
Enabled: false
|
2015-04-29 00:27:56 +08:00
|
|
|
Style/WhileUntilModifier:
|
|
|
|
Enabled: false
|
2016-01-15 23:44:38 +08:00
|
|
|
Style/ParallelAssignment:
|
|
|
|
Enabled: false
|
2016-12-28 14:17:05 +08:00
|
|
|
Style/ZeroLengthPredicate:
|
|
|
|
Enabled: false
|
|
|
|
Style/NumericPredicate:
|
|
|
|
Enabled: false
|
2018-01-03 01:29:58 +08:00
|
|
|
Naming/VariableNumber:
|
2016-12-28 14:17:05 +08:00
|
|
|
Enabled: false
|
2017-10-30 06:15:03 +08:00
|
|
|
Style/Dir:
|
|
|
|
Enabled: false
|
|
|
|
Style/ReturnNil:
|
|
|
|
Enabled: false
|
2017-10-30 11:02:24 +08:00
|
|
|
Style/StderrPuts:
|
|
|
|
Enabled: false
|
|
|
|
Style/DateTime:
|
|
|
|
Enabled: false
|
2018-03-20 03:56:20 +08:00
|
|
|
Style/SymbolArray:
|
|
|
|
Enabled: false
|
2017-01-05 01:51:58 +08:00
|
|
|
# We may want to enable this when we start working toward Ruby 3
|
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
Enabled: false
|
2018-02-16 01:25:36 +08:00
|
|
|
Style/AsciiComments:
|
|
|
|
Enabled: false
|
2018-08-07 22:47:36 +08:00
|
|
|
Style/BlockDelimiters:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- spec/**/*_spec.rb
|
|
|
|
- spec/shared_examples/**/*.rb
|
2016-12-28 14:17:05 +08:00
|
|
|
|
2017-02-09 08:12:05 +08:00
|
|
|
# RSpec cops we don't care about
|
2017-02-10 01:16:29 +08:00
|
|
|
RSpec/MessageSpies:
|
|
|
|
Enabled: false
|
2017-02-09 08:12:05 +08:00
|
|
|
RSpec/HookArgument:
|
2017-02-01 02:26:34 +08:00
|
|
|
Enabled: false
|
2018-02-16 01:25:36 +08:00
|
|
|
RSpec/VerifiedDoubles:
|
|
|
|
Enabled: false
|
2018-04-26 00:37:10 +08:00
|
|
|
RSpec/NamedSubject:
|
|
|
|
Enabled: false
|
2018-08-03 01:08:40 +08:00
|
|
|
RSpec/NotToNot:
|
|
|
|
Enabled: false
|
2017-03-04 04:08:13 +08:00
|
|
|
# RSpec cops we care extra about
|
|
|
|
RSpec/EmptyExampleGroup:
|
|
|
|
Severity: error
|
2017-03-04 06:26:51 +08:00
|
|
|
RSpec/RepeatedDescription:
|
|
|
|
Severity: error
|
2018-08-30 02:30:46 +08:00
|
|
|
RSpec/ExpectChange:
|
|
|
|
Enabled: false
|
2017-03-04 04:08:13 +08:00
|
|
|
|
2016-12-28 14:17:05 +08:00
|
|
|
# this isn't good for us because of how we pin dependencies
|
|
|
|
Bundler/OrderedGems:
|
|
|
|
Enabled: false
|
2017-10-30 11:02:24 +08:00
|
|
|
Gemspec/OrderedDependencies:
|
|
|
|
Enabled: false
|
2017-12-20 04:08:55 +08:00
|
|
|
Gemspec/RequiredRubyVersion:
|
|
|
|
Enabled: false
|
2015-04-15 06:47:24 +08:00
|
|
|
|
|
|
|
# Rails style changes
|
2018-03-20 23:24:54 +08:00
|
|
|
Migration/ModelBehavior:
|
|
|
|
Enabled: false
|
2016-12-28 14:17:05 +08:00
|
|
|
Rails:
|
|
|
|
Enabled: true
|
2015-04-14 00:16:46 +08:00
|
|
|
Rails/TimeZone:
|
|
|
|
Enabled: false
|
2015-04-27 23:39:18 +08:00
|
|
|
# accessors are often defined in terms of read_attribute
|
|
|
|
Rails/ReadWriteAttribute:
|
|
|
|
Enabled: false
|
2017-07-28 04:52:39 +08:00
|
|
|
# we never bothered creating an ApplicationRecord
|
|
|
|
Rails/ApplicationRecord:
|
|
|
|
Enabled: false
|
2017-10-30 06:15:03 +08:00
|
|
|
Rails/HasManyOrHasOneDependent:
|
|
|
|
Enabled: false
|
2018-02-16 01:25:36 +08:00
|
|
|
# It whines about update_all too much, which we use a lot specifically to
|
|
|
|
# bypass validations and any other AR-ness
|
|
|
|
Rails/SkipsModelValidations:
|
|
|
|
Enabled: false
|
2015-04-10 22:43:59 +08:00
|
|
|
|
2015-04-15 06:47:24 +08:00
|
|
|
# Lint changes
|
|
|
|
Lint/AmbiguousRegexpLiteral:
|
|
|
|
Severity: convention
|
2018-02-08 23:26:27 +08:00
|
|
|
Lint/AmbiguousBlockAssociation:
|
|
|
|
Exclude:
|
2018-05-30 01:05:34 +08:00
|
|
|
- spec/**/*
|
2015-04-16 04:49:06 +08:00
|
|
|
Lint/UselessAssignment:
|
|
|
|
Severity: convention
|
2015-04-25 03:27:58 +08:00
|
|
|
Lint/Debugger:
|
|
|
|
Severity: error
|
2015-04-27 23:39:18 +08:00
|
|
|
Lint/EndAlignment:
|
2018-03-14 03:15:16 +08:00
|
|
|
EnforcedStyleAlignWith: variable
|
2015-04-27 23:39:18 +08:00
|
|
|
Severity: convention
|
2015-04-15 06:47:24 +08:00
|
|
|
|
|
|
|
# Performance changes
|
|
|
|
Performance/Detect:
|
|
|
|
Severity: warning
|
2018-08-30 02:30:46 +08:00
|
|
|
Performance/TimesMap:
|
|
|
|
Exclude:
|
|
|
|
- spec/**/*
|
2015-04-15 06:47:24 +08:00
|
|
|
|
2015-04-10 22:43:59 +08:00
|
|
|
# these need better configuration than the default:
|
|
|
|
Style/AndOr:
|
|
|
|
EnforcedStyle: conditionals
|
2016-12-28 14:17:05 +08:00
|
|
|
Style/RescueModifier:
|
|
|
|
Severity: warning
|
2018-01-03 01:29:58 +08:00
|
|
|
Layout/MultilineMethodCallIndentation:
|
2016-12-28 14:17:05 +08:00
|
|
|
EnforcedStyle: indented
|
2018-01-03 01:29:58 +08:00
|
|
|
Layout/IndentArray:
|
2016-12-28 14:17:05 +08:00
|
|
|
EnforcedStyle: consistent
|
2015-04-10 03:55:31 +08:00
|
|
|
|
|
|
|
# these don't make sense pre-Rails 4
|
|
|
|
Rails/FindBy:
|
|
|
|
Enabled: false
|
2015-04-10 21:37:58 +08:00
|
|
|
Rails/ActionFilter:
|
|
|
|
Enabled: false
|
2015-04-10 03:55:31 +08:00
|
|
|
|
2017-01-21 22:18:29 +08:00
|
|
|
# these are invalid pre-Rails 5
|
|
|
|
Rails/HttpPositionalArguments:
|
|
|
|
Enabled: false
|
|
|
|
|
2017-02-01 02:26:34 +08:00
|
|
|
# these are invalid pre-Ruby 2.4
|
|
|
|
Performance/RegexpMatch:
|
|
|
|
Enabled: false
|
|
|
|
|
2015-04-10 03:55:31 +08:00
|
|
|
# Things we may want to tighten down later
|
2015-04-11 02:29:31 +08:00
|
|
|
Metrics/AbcSize:
|
2015-04-15 06:47:24 +08:00
|
|
|
Enabled: false
|
2015-04-10 03:55:31 +08:00
|
|
|
Metrics/LineLength:
|
2018-02-16 01:25:36 +08:00
|
|
|
Max: 160
|
2015-04-10 03:55:31 +08:00
|
|
|
Metrics/MethodLength:
|
2018-02-16 01:25:36 +08:00
|
|
|
Max: 100
|
|
|
|
Metrics/ClassLength:
|
|
|
|
Enabled: false
|
|
|
|
Metrics/ModuleLength:
|
|
|
|
Enabled: false
|
2017-02-09 08:12:05 +08:00
|
|
|
Metrics/BlockLength:
|
2018-02-16 01:25:36 +08:00
|
|
|
Max: 50
|
2017-02-09 08:12:05 +08:00
|
|
|
Exclude:
|
2018-05-30 01:05:34 +08:00
|
|
|
- gems/*/spec/**/*.rb
|
|
|
|
- gems/plugins/*/spec_canvas/**/*.rb
|
|
|
|
- spec/**/*.rb
|
2018-07-10 02:26:04 +08:00
|
|
|
- pact/spec/**/*_spec.rb
|
2015-04-11 02:29:31 +08:00
|
|
|
Metrics/CyclomaticComplexity:
|
2018-02-16 01:25:36 +08:00
|
|
|
Max: 28
|
|
|
|
Metrics/PerceivedComplexity:
|
|
|
|
Max: 28
|
2015-04-10 06:29:09 +08:00
|
|
|
RSpec/InstanceVariable:
|
|
|
|
Enabled: false
|
|
|
|
RSpec/ExampleWording:
|
|
|
|
Enabled: false
|
2018-02-16 01:25:36 +08:00
|
|
|
RSpec/ContextWording:
|
|
|
|
Enabled: false
|
2017-01-05 01:51:58 +08:00
|
|
|
RSpec/ExampleLength:
|
2018-02-16 01:25:36 +08:00
|
|
|
Max: 48
|
2017-01-21 00:35:25 +08:00
|
|
|
RSpec/NestedGroups:
|
2017-02-01 02:26:34 +08:00
|
|
|
Max: 5
|
2015-04-10 06:29:09 +08:00
|
|
|
RSpec/DescribedClass:
|
|
|
|
Enabled: false
|
2015-04-15 06:21:54 +08:00
|
|
|
RSpec/DescribeClass:
|
|
|
|
Enabled: false
|
2015-04-11 04:49:20 +08:00
|
|
|
Style/HashSyntax:
|
|
|
|
Enabled: false
|
2017-01-05 01:51:58 +08:00
|
|
|
RSpec/MultipleExpectations:
|
|
|
|
Enabled: false
|
2017-02-01 02:26:34 +08:00
|
|
|
RSpec/ScatteredSetup:
|
|
|
|
Enabled: false
|
2018-01-03 01:29:58 +08:00
|
|
|
Style/RescueStandardError:
|
2017-10-30 06:15:03 +08:00
|
|
|
Enabled: false
|
2018-05-30 01:05:34 +08:00
|
|
|
|
|
|
|
Specs/EnsureSpecExtension:
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- spec/shared_examples/**/*
|