-
Notifications
You must be signed in to change notification settings - Fork 1
/
rubocop-treatwell-style.yml
140 lines (107 loc) · 2.88 KB
/
rubocop-treatwell-style.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
133
134
135
136
137
138
139
140
# This file will inherit from default rubocop config located at
# https://github.com/rubocop/rubocop/blob/master/config/default.yml
# and other default config from gems, like rubocop-rails, rubocop-rspec, etc.
# Some of the default rules are not meant/compatible for monorepo structure
# especially if you run rubocop on the whole repo, so we need to override them.
# e.g. default config has a global exclusion list for stuff located in root folder
#
# Exclude: Exclude:
# - 'node_modules/**/*'
# - 'tmp/**/*'
#
# This is not appliable for monorepo structure, if you run rubocop from the root
# folder it will try to analyze stuff in <app>/tmp, while when run in <app> folder
# it works as intended. We need to tweak include/exclude using better glob patterns
# (e.g. **/tmp/**/*). Also never use relative paths in Include/Exclude, rules, always use
# '**/bin/**/*' instead of './bin/**/*' to avoid issues with working directory when runnint it.
inherit_from:
- https://relaxed.ruby.style/rubocop.yml
require:
- rubocop-performance
- rubocop-rspec
- rubocop-rails
- rubocop-treatwell
Bundler/OrderedGems:
Exclude:
- '**/Gemfile'
Layout/CaseIndentation:
EnforcedStyle: end
Layout/EndAlignment:
EnforcedStyleAlignWith: start_of_line
Layout/ExtraSpacing:
Exclude:
- '**/config/routes.rb'
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/HashAlignment:
EnforcedColonStyle:
- key
- table
EnforcedHashRocketStyle:
- key
- table
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/SpaceBeforeFirstArg:
Exclude:
- '**/config/routes.rb'
Layout/SpaceInsideParens:
EnforcedStyle: no_space
Layout/TrailingEmptyLines:
Enabled: true
Lint/AmbiguousBlockAssociation:
AllowedMethods:
- change
- not_change
- have_enqueued_job
- with
- once
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true
Metrics/BlockLength:
Exclude:
- '**/config/routes.rb'
Metrics/MethodLength:
Max: 80
Metrics/ParameterLists:
Max: 8
Naming/MethodParameterName:
AllowedNames: io, id, to, by, on, in, at, ip, db, as
Rails/WhereExists:
EnforcedStyle: where
Rails/SkipsModelValidations:
Exclude:
- '**/db/main/migrate/**/*'
- '**/spec/**/*'
Rails/UnscopedOverNonModelConstant:
Enabled: true
AllowedMethods:
- class
- constantize
- klass
RSpec/ExampleLength:
Max: 20
RSpec/MultipleMemoizedHelpers:
Max: 10
RSpec/MessageSpies:
Enabled: false
RSpec/NamedSubject:
Enabled: false
RSpec/NestedGroups:
Max: 5
RSpec/StubbedMock:
Enabled: false
Style/AsciiComments:
AllowedChars:
- '€'
Style/FormatStringToken:
Exclude:
- '**/config/routes.rb'
Style/HashSyntax:
EnforcedShorthandSyntax: never
Style/PreferredHashMethods:
EnforcedStyle: 'verbose'
Style/RescueStandardError:
EnforcedStyle: 'implicit'