-
-
Notifications
You must be signed in to change notification settings - Fork 109
/
.rubocop_opinionated.yml
135 lines (113 loc) · 3.27 KB
/
.rubocop_opinionated.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
AllCops:
Exclude:
# Exclude .gemspec files because they are generally auto-generated
- '*.gemspec'
# Exclude vendored folders
- 'tmp/**/*'
- 'vendor/**/*'
NewCops: enable
# [codesmell]
Layout/LineLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
Max: 100
# [codesmell]
Metrics/AbcSize:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
# [codesmell]
Metrics/BlockLength:
Enabled: false
# [codesmell]
Metrics/CyclomaticComplexity:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
# [codesmell]
Metrics/ClassLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
# [codesmell]
Metrics/MethodLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
Max: 10
# [codesmell]
Metrics/ModuleLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
# [codesmell]
Metrics/ParameterLists:
Enabled: false
Max: 5
# [codesmell]
Metrics/PerceivedComplexity:
Enabled: false
# Do not use "and" or "or" in conditionals, but for readability we can use it
# to chain executions. Just beware of operator order.
Style/AndOr:
EnforcedStyle: conditionals
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
# Double empty lines are useful to separate conceptually different methods
# in the same class or module.
Layout/EmptyLines:
Enabled: false
# In most cases, a space is nice. Sometimes, it's not.
# Just be consistent with the rest of the surrounding code.
Layout/EmptyLinesAroundClassBody:
Enabled: false
# In most cases, a space is nice. Sometimes, it's not.
# Just be consistent with the rest of the surrounding code.
Layout/EmptyLinesAroundModuleBody:
Enabled: false
# This is quite buggy, as it doesn't recognize double lines.
# Double empty lines are useful to separate conceptually different methods
# in the same class or module.
Layout/EmptyLineBetweenDefs:
Enabled: false
# Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
# %s is a simpler and straightforward version that works in almost all cases. So don't complain.
Style/FormatStringToken:
Enabled: false
# unless is not always cool.
Style/NegatedIf:
Enabled: false
# There are cases were the inline rescue is ok. We can either downgrade the severity,
# or rely on the developer judgement on a case-by-case basis.
Style/RescueModifier:
Enabled: false
Style/SymbolArray:
EnforcedStyle: brackets
# Hate It or Love It, I prefer double quotes as this is more consistent
# with several other programming languages and the output of puts and inspect.
Style/StringLiterals:
EnforcedStyle: double_quotes
# It's nice to be consistent. The trailing comma also allows easy reordering,
# and doesn't cause a diff in Git when you add a line to the bottom.
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrivialAccessors:
# IgnoreClassMethods because I want to be able to define class-level accessors
# that sets an instance variable on the metaclass, such as:
#
# def self.default=(value)
# @default = value
# end
#
IgnoreClassMethods: true