-
Notifications
You must be signed in to change notification settings - Fork 13
/
.rubocop.yml
132 lines (115 loc) · 2.96 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
AllCops:
Include:
- '**/Rakefile'
- '**/config.ru'
- 'app/channels/**/*.rb'
- 'app/helpers/**/*.rb'
- 'app/interactors/**/*.rb'
- 'app/jobs/**/*.rb'
- 'app/lib/**/*.rb'
- 'app/mailers/**/*.rb'
- 'app/serializers/**/*.rb'
- 'app/workers/**/*.rb'
- 'app/deserializers/**/*.rb'
- 'app/controllers/**/*.rb'
- 'app/models/**/*.rb'
- 'app/services/**/*.rb'
- '/lib/**/*.rb'
- 'config/**/*.rb'
- 'db/seeds.rb'
- 'spec/**/*'
Exclude:
- '**/*.yml'
- '__mocks__/**/*'
- '__tests__/**/*'
- '__js_test_config'
- Gemfile*
- 'db/migrate/*'
- 'db/schema.rb'
- 'db/import/*'
- 'app/assets/**/*'
- 'app/javascript/**/*'
- 'app/views/**/*'
- 'bin/**/*'
- 'spec/support/api/**/*'
- 'spec/support/api/schemas/*.json'
- 'spec/fixtures/**/*'
- 'vendor/bundle/**/*'
- 'node_modules/**/*'
- 'config/environments/production.rb'
- 'config/initializers/devise.rb'
- 'config/*.yml'
- 'config/locales/*'
- 'config/webpack/*'
# We don't care about method length, since we check method cyclomatic
# complexity.
Metrics/MethodLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/PerceivedComplexity:
Max: 10
Metrics/CyclomaticComplexity:
Max: 8
Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
# a Float.
Max: 35
Naming/PredicateName:
# because of methods like `has_role?` we don't want to enforce 'has_' prefix
NamePrefixBlacklist:
- 'is_'
- 'have_'
# Trailing commas make for clearer diffs because the last line won't appear
# to have been changed, as it would if it lacked a comma and had one added.
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
PreferredDelimiters:
# Using `[]` for string arrays instead of `()`, since normal arrays are
# indicated with `[]` not `()`.
'%w': '[]'
'%W': '[]'
Style/AsciiComments:
AllowedChars:
- '∆'
Style/AndOr:
# `and` and `or` banned only in conditionals (conditionals), or completely (always).
EnforcedStyle: 'always'
Style/BlockDelimiters:
Exclude:
- 'spec/**/*.rb'
Style/IfUnlessModifier:
Enabled: false
Style/ClassAndModuleChildren:
Exclude:
- 'app/controllers/**/*'
Style/EmptyMethod:
Enabled: false
Style/ConditionalAssignment:
Enabled: false
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/Lambda:
Enabled: false
Metrics/LineLength:
Max: 140
Exclude:
- 'config/routes.rb'
Metrics/BlockLength:
Max: 25
Exclude:
- 'config/routes.rb'
- 'Guardfile'
- 'spec/**/*.rb'
- 'lib/tasks/cypress.rake'
Layout/IndentFirstArrayElement:
EnforcedStyle: 'consistent'