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
|
|
|
|
Style/StringLiterals:
|
|
|
|
Enabled: false
|
|
|
|
Style/SignalException:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceBeforeBlockBraces:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceInsideBlockBraces:
|
|
|
|
Enabled: false
|
|
|
|
Style/NumericLiterals:
|
|
|
|
Enabled: false
|
|
|
|
Style/BracesAroundHashParameters:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceInsideBrackets:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceInsideHashLiteralBraces:
|
|
|
|
Enabled: false
|
|
|
|
Style/PercentLiteralDelimiters:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceAroundOperators:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceAfterColon:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceAfterComma:
|
|
|
|
Enabled: false
|
|
|
|
Style/Documentation:
|
|
|
|
Enabled: false
|
|
|
|
Style/ClassAndModuleChildren:
|
|
|
|
Enabled: false
|
|
|
|
Style/RegexpLiteral:
|
|
|
|
Enabled: false
|
|
|
|
Style/EmptyLines:
|
|
|
|
Enabled: false
|
|
|
|
Style/EmptyLinesAroundMethodBody:
|
|
|
|
Enabled: false
|
|
|
|
Style/EmptyLinesAroundClassBody:
|
|
|
|
Enabled: false
|
|
|
|
Style/EmptyLinesAroundModuleBody:
|
|
|
|
Enabled: false
|
2015-04-10 03:55:31 +08:00
|
|
|
Style/EmptyLinesAroundBlockBody:
|
|
|
|
Enabled: false
|
2015-04-05 08:49:25 +08:00
|
|
|
Style/GuardClause:
|
|
|
|
Enabled: false
|
|
|
|
Style/RedundantSelf:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceAroundEqualsInParameterDefault:
|
|
|
|
Enabled: false
|
2016-12-28 14:17:05 +08:00
|
|
|
Style/SpaceBeforeFirstArg:
|
2015-04-05 08:49:25 +08:00
|
|
|
Enabled: false
|
|
|
|
Style/EmptyLinesAroundAccessModifier:
|
|
|
|
Enabled: false
|
|
|
|
Style/IfUnlessModifier:
|
|
|
|
Enabled: false
|
|
|
|
Style/WordArray:
|
|
|
|
Enabled: false
|
|
|
|
Style/PercentQLiterals:
|
|
|
|
Enabled: false
|
|
|
|
Style/IndentHash:
|
|
|
|
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
|
2015-04-10 22:43:59 +08:00
|
|
|
Style/TrailingBlankLines:
|
|
|
|
Enabled: false
|
2015-04-11 00:52:01 +08:00
|
|
|
Style/IndentationConsistency:
|
|
|
|
Enabled: false
|
|
|
|
Style/IndentationWidth:
|
|
|
|
Enabled: false
|
2015-04-14 02:20:55 +08:00
|
|
|
Style/AlignParameters:
|
|
|
|
Enabled: false
|
2015-04-16 04:49:06 +08:00
|
|
|
Style/DotPosition:
|
|
|
|
Enabled: false
|
|
|
|
Style/TrailingWhitespace:
|
|
|
|
Enabled: false
|
|
|
|
Style/MultilineOperationIndentation:
|
|
|
|
Enabled: false
|
|
|
|
Style/AlignHash:
|
|
|
|
Enabled: false
|
|
|
|
Style/AlignParameters:
|
|
|
|
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/SpaceInLambdaLiteral:
|
|
|
|
Enabled: false
|
|
|
|
Style/NumericPredicate:
|
|
|
|
Enabled: false
|
|
|
|
Style/VariableNumber:
|
|
|
|
Enabled: false
|
|
|
|
Style/SpaceInLambdaLiteral:
|
|
|
|
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
|
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
|
2015-04-10 22:43:59 +08:00
|
|
|
|
2015-04-15 06:47:24 +08:00
|
|
|
# Lint changes
|
|
|
|
Lint/AmbiguousRegexpLiteral:
|
|
|
|
Severity: convention
|
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
|
|
|
|
Style/MultilineMethodCallIndentation:
|
|
|
|
EnforcedStyle: indented
|
|
|
|
Style/IndentArray:
|
|
|
|
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
|