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
|
|
|
|
|
|
|
|
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
|
2018-01-03 01:29:58 +08:00
|
|
|
Layout/AlignParameters:
|
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
|
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
|
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
|
|
|
|
|
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
|
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
|
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
|
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:
|
|
|
|
- "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:
|
|
|
|
Severity: convention
|
2015-04-15 06:47:24 +08:00
|
|
|
|
|
|
|
# Performance changes
|
|
|
|
Performance/Detect:
|
|
|
|
Severity: warning
|
|
|
|
|
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:
|
2015-04-10 06:29:09 +08:00
|
|
|
Max: 120
|
2015-04-10 03:55:31 +08:00
|
|
|
Metrics/MethodLength:
|
2015-04-10 06:29:09 +08:00
|
|
|
Max: 16
|
2017-02-09 08:12:05 +08:00
|
|
|
Metrics/BlockLength:
|
|
|
|
Exclude:
|
|
|
|
- 'gems/*/spec/**/*.rb'
|
|
|
|
- 'gems/plugins/*/spec_canvas/**/*.rb'
|
|
|
|
- 'spec/**/*.rb'
|
2015-04-11 02:29:31 +08:00
|
|
|
Metrics/CyclomaticComplexity:
|
|
|
|
Max: 10
|
2015-04-10 06:29:09 +08:00
|
|
|
RSpec/InstanceVariable:
|
|
|
|
Enabled: false
|
|
|
|
RSpec/ExampleWording:
|
|
|
|
Enabled: false
|
2017-01-05 01:51:58 +08:00
|
|
|
RSpec/ExampleLength:
|
|
|
|
Max: 16
|
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
|