forked from publify/publify_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
171 lines (133 loc) · 3.93 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
require:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
AllCops:
Exclude:
- 'bin/*'
- 'spec/dummy/bin/*'
- 'spec/dummy/db/schema.rb'
TargetRubyVersion: 2.4
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
# Lenient line length that fits in pull requests
Layout/LineLength:
Max: 92
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
# Uniform block layout
Layout/SpaceBeforeBlockBraces:
EnforcedStyleForEmptyBraces: space
# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
# Allow if (foo = get_foo) style
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# Suppress BlockLength for some files:
# - Spec describe blocks can be any length
# - Routes blocks can be any length
# - FactoryBot factory blocks can be any length
# - Gem specification blocks can be any length
Metrics/BlockLength:
Exclude:
- 'publify_core.gemspec'
- 'config/routes.rb'
- 'lib/publify_core/testing_support/factories.rb'
- 'spec/**/*'
# Initial schema has a very large change method
Metrics/MethodLength:
Exclude:
- 'db/migrate/113_initial_schema.rb'
# Do not require long paths to be split by comma's.
Rails/FilePath:
Enabled: false
# Migrations should not use ApplicationRecord
Rails/ApplicationRecord:
Exclude:
- 'db/migrate/*'
# This cop has issues and is too database-specific
Rails/BulkChangeTable:
Enabled: false
# The manifest and i18n tasks do not need environment
Rails/RakeEnvironment:
Exclude:
- 'lib/tasks/manifest.rake'
- 'lib/tasks/i18n.rake'
# Migrations should not do validations in general?
Rails/SkipsModelValidations:
Exclude:
- 'db/migrate/*'
# Allow the use of 'and' 'or' in control structures.
Style/AndOr:
EnforcedStyle: conditionals
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Enabled: true
# Documenting all classes is not common in Rails projects.
Style/Documentation:
Enabled: false
# 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
# This cop has too many false positives
# TODO: Re-enable once fixed
Style/FormatStringToken:
Enabled: false
# Require at least two dependent lines before suggesting a guard clause
Style/GuardClause:
MinBodyLength: 2
# 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 not to commit to need to interpolate
Style/StringLiterals:
EnforcedStyle: double_quotes
# Be consistent with non-interpolated strings
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets
# Prefer consistent lines for multi-line arrays
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
# Prefer consistent lines for multi-line hashes
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# Allow small arrays of words with quotes
Style/WordArray:
MinSize: 4
inherit_from: .rubocop_todo.yml