-
Notifications
You must be signed in to change notification settings - Fork 2
/
.rubocop.yml
74 lines (59 loc) · 1.47 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
inherit_from: .rubocop_todo.yml
require: rubocop-rspec
AllCops:
DisplayCopNames: true
Include:
- './Rakefile'
- './config.ru'
- '**/*.rb'
- '**/*.rake'
Exclude:
- 'bin/**/*'
- 'config/environments/*.rb'
- 'config/erubis_monkeypatch.rb' # code essentially copied from rails
- 'db/**/*'
- 'vendor/**/*'
Layout/EmptyLineAfterGuardClause: # overkill
Enabled: false
# rspec expect{...} is conventional
Layout/SpaceBeforeBlockBraces:
Exclude:
- 'spec/**/*_spec.rb'
Metrics/BlockLength:
ExcludedMethods:
- SimpleForm.setup
- FactoryBot.define
- factory
- describe
- context
- it
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 200
Exclude:
- 'config/initializers/**/*.rb' # generated files
RSpec/ContextWording:
Enabled: false # too dogmatic
# Offense count: 2
RSpec/DescribeClass:
Exclude:
- 'spec/views/**/*.rb' # In view tests, the view is named, not the class
RSpec/ExampleLength:
Enabled: false
RSpec/ImplicitSubject: # we use this for `define_enum_for`, `validate_presence_of`, etc.
Enabled: false
# we like 'expect(x).to receive' better than 'have_received'
RSpec/MessageSpies:
Enabled: false
RSpec/MultipleExpectations:
Max: 5
Exclude:
- 'spec/features/*'
RSpec/NestedGroups:
Max: 4 # default: 3
Style/NumericPredicate: # "> 0" is not less readable than ".positive?"
Enabled: false
Style/RegexpLiteral:
Enabled: false
Style/SymbolArray:
MinSize: 4