forked from gavinlaking/vedeu_cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
182 lines (150 loc) · 5.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
181
# This is the default configuration file. Enabling and disabling is configured
# in separate files. This file adds all other parameters apart from Enabled.
inherit_from:
- config/rubocop_enabled.yml
- config/rubocop_disabled.yml
# Common configuration.
AllCops:
# Include gemspec and Rakefile
Include:
- '**/*.gemspec'
- '**/*.podspec'
- '**/*.jbuilder'
- '**/*.rake'
- '**/*.opal'
- '**/Gemfile'
- '**/Rakefile'
- '**/Capfile'
- '**/Guardfile'
- '**/Podfile'
- '**/Thorfile'
- '**/Vagrantfile'
- '**/Berksfile'
- '**/Cheffile'
- '**/Vagabondfile'
Exclude:
- 'test/**/*'
- 'vendor/**/*'
# By default, the rails cops are not run. Override in project or home
# directory .rubocop.yml files, or by giving the -R/--rails option.
RunRailsCops: false
# Cop names are not displayed in offense messages by default. Change behavior
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
# option.
DisplayCopNames: true
# Style guide URLs are not displayed in offense messages by default. Change
# behavior by overriding DisplayStyleGuide, or by giving the
# -S/--display-style-guide option.
DisplayStyleGuide: false
# Additional cops that do not reference a style guide rule may be enabled by
# default. Change behavior by overriding StyleGuideCopsOnly, or by giving
# the --only-guide-cops option.
StyleGuideCopsOnly: false
Style/EmptyLinesAroundBlockBody:
EnforcedStyle: no_empty_lines
Style/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines
Style/EmptyLinesAroundModuleBody:
EnforcedStyle: empty_lines
# Built-in global variables are allowed by default.
Style/GlobalVars:
AllowedVariables: [$LIB_DIR]
# `MinBodyLength` defines the number of lines of the a body of an if / unless
# needs to have to trigger this cop
Style/GuardClause:
MinBodyLength: 1
Style/IfUnlessModifier:
MaxLineLength: 80
Style/IndentationWidth:
Width: 2
# Checks the indentation of the first key in a hash literal.
Style/IndentHash:
# The value `special_inside_parentheses` means that hash literals with braces
# that have their opening brace on the same line as a surrounding opening
# round parenthesis, shall have their first key indented relative to the
# first position inside the parenthesis.
# The value `consistent` means that the indentation of the first key shall
# always be relative to the first position of the line where the opening
# brace is.
EnforcedStyle: special_inside_parentheses
SupportedStyles:
- special_inside_parentheses
- consistent
Style/ModuleFunction:
Enabled: false
Style/Next:
# With `always` all conditions at the end of an iteration needs to be
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
EnforcedStyle: skip_modifier_ifs
# `MinBodyLength` defines the number of lines of the a body of an if / unless
# needs to have to trigger this cop
MinBodyLength: 3
SupportedStyles:
- skip_modifier_ifs
- always
Style/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space
Style/SpaceBeforeBlockBraces:
EnforcedStyle: space
Style/SpaceInsideBlockBraces:
EnforcedStyle: space
Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
Style/TrailingBlankLines:
EnforcedStyle: final_newline
Style/TrailingComma:
EnforcedStyleForMultiline: comma
##################### Metrics ##################################
Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
# a Float.
Max: 20
Metrics/BlockNesting:
Max: 3
Metrics/ClassLength:
CountComments: false # count full line comments?
Max: 100
# Avoid complex methods.
Metrics/CyclomaticComplexity:
Max: 10
Metrics/LineLength:
Max: 80
# To make it possible to copy or click on URIs in the code, we allow lines
# contaning a URI to be longer than Max.
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
CountComments: false # count full line comments?
Max: 70
Metrics/ParameterLists:
Max: 5
CountKeywordArgs: true
Metrics/PerceivedComplexity:
Max: 12
##################### Lint ##################################
# Allow safe assignment in conditions.
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# Align ends correctly.
Lint/EndAlignment:
# The value `keyword` means that `end` should be aligned with the matching
# keyword (if, while, etc.).
# The value `variable` means that in assignments, `end` should be aligned
# with the start of the variable on the left hand side of `=`. In all other
# situations, `end` should still be aligned with the keyword.
AlignWith: keyword
SupportedStyles:
- keyword
- variable
Lint/DefEndAlignment:
# The value `def` means that `end` should be aligned with the def keyword.
# The value `start_of_line` means that `end` should be aligned with method
# calls like `private`, `public`, etc, if present in front of the `def`
# keyword on the same line.
AlignWith: start_of_line
SupportedStyles:
- start_of_line
- def