/
.rubocop.yml
180 lines (143 loc) · 4.04 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
AllCops:
Exclude:
- 'bin/**/*'
- 'config/**/*'
- 'tmp/**/*'
- 'publify_core/bin/*'
- 'publify_core/spec/dummy/**/*'
- 'publify_amazon_sidebar/bin/*'
- 'publify_amazon_sidebar/spec/dummy/**/*'
- 'publify_textfilter_code/bin/*'
- 'publify_textfilter_code/spec/dummy/**/*'
- 'db/converters/*.rb'
- 'db/scripts/fix_permalinks.rb'
- 'db/schema.rb'
TargetRubyVersion: '2.2'
Rails:
Enabled: true
# We have duplication due to extra logic in the Gemfile
Bundler/DuplicatedGem:
Enabled: false
# Place . on the previous line
Layout/DotPosition:
EnforcedStyle: trailing
# Do not use unnecessary spacing.
Layout/ExtraSpacing:
Enabled: true
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: same_line
# Multi-line operations should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Multi-line operations should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
# Allow if (foo = get_foo) style
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# TODO: Lower Max and fix offenses
Metrics/AbcSize:
Max: 155
# Suppress BlockLength for some files:
# - Spec describe blocks can be any length
# - Routes blocks can be any length
# - Gem specification blocks can be any length
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '**/*.gemspec'
- 'publify_core/config/routes.rb'
- 'publify_core/spec/**/*'
- 'publify_amazon_sidebar/spec/**/*'
- 'publify_textfilter_code/spec/**/*'
# TODO: Lower Max and fix offenses
Metrics/ClassLength:
Max: 225
# TODO: Lower Max and fix offenses
Metrics/CyclomaticComplexity:
Max: 17
# TODO: Lower Max and fix offenses
Metrics/LineLength:
Max: 274
# Initial schema has a very large change method
# TODO: Lower Max and fix offenses
Metrics/MethodLength:
Exclude:
- 'publify_core/db/migrate/113_initial_schema.rb'
- 'db/migrate/113_initial_schema.publify_core_engine.rb'
Max: 45
# TODO: Lower Max and fix offenses
Metrics/ModuleLength:
Max: 211
# Offense count: 1
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 6
# Offense count: 8
Metrics/PerceivedComplexity:
Max: 17
# Do not require long paths to be split by comma's.
Rails/FilePath:
Enabled: false
# Documenting all classes is not common in Rails projects.
Style/Documentation:
Enabled: false
# TODO: Lower Max and fix offenses
# Target is around 100
Metrics/LineLength:
Max: 274
# Migrations should not use ApplicationRecord
Rails/ApplicationRecord:
Exclude:
- 'db/migrate/*'
- 'publify_core/db/migrate/*'
# Migrations should not do validations in general?
Rails/SkipsModelValidations:
Exclude:
- 'db/migrate/*'
- 'publify_core/db/migrate/*'
# Allow the use of 'and' 'or' in control structures.
Style/AndOr:
EnforcedStyle: conditionals
# Allow multiple Hash parameters to look similar
Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Enabled: true
# This cop doesn't detect use of break yet
Style/EachWithObject:
Enabled: false
# Allows format strings with: format, sprintf or percent.
Style/FormatString:
Enabled: false
# TODO: Re-enable?
Style/NumericPredicate:
Enabled: false
# Not all objects that implement #size implement #empty?
Style/ZeroLengthPredicate:
Enabled: false
# Restore previous RuboCop defaults
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%W': ()
'%w': ()
# Always use raise to raise exceptions
Style/SignalException:
EnforcedStyle: only_raise
# Allow meaningful names for single-line reduce etc.
Style/SingleLineBlockParams:
Enabled: false
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets
# Allow small arrays of words with quotes
Style/WordArray:
MinSize: 4
inherit_from: .rubocop_todo.yml