forked from DylanAndrews/weatherfetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
185 lines (140 loc) · 4.34 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
182
183
184
185
AllCops:
DisabledByDefault: true
DisplayCopNames: true
TargetRubyVersion: 2.7.1
Exclude:
- 'bin/**/*'
- 'vendor/**/*'
# Indent private/protected/public as deep as method definitions
Layout/AccessModifierIndentation:
EnforcedStyle: indent
# Don't use `and` or `or` in conditionals
Style/AndOr:
EnforcedStyle: conditionals
# Checks formatting of special comments
Style/CommentAnnotation:
Keywords:
- TODO
- HACK
- TEMP
# Align `end` with `def`
Layout/DefEndAlignment:
EnforcedStyleAlignWith: def
# Multi-line method chaining should be done with leading dots.
Layout/DotPosition:
EnforcedStyle: leading
# Warn on empty else statements
Style/EmptyElse:
EnforcedStyle: empty
# Checks for empty lines around the bodies of classes
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: no_empty_lines
# Checks for empty lines around the bodies of modules
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: no_empty_lines
# `end` should be aligned with the matching keyword (if, while, etc.).
Layout/EndAlignment:
EnforcedStyleAlignWith: keyword
Layout/ExtraSpacing:
AllowForAlignment: true
ForceEqualSignAlignment: false
# The first parameter should always be indented one step more than the preceding line.
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
# Checks use of for or each in multiline loops.
Style/For:
EnforcedStyle: each
# Force js-style hash syntax
Style/HashSyntax:
EnforcedStyle: ruby19
# Use consistent indentation
Layout/IndentationConsistency:
EnforcedStyle: normal
# Number of spaces for each indentation level.
Layout/IndentationWidth:
Width: 2
# The indentation of the first element shall always be relative to the first position
# of the line where the opening bracket is.
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# Require parens for args in method definitions
Style/MethodDefParentheses:
EnforcedStyle: require_parentheses
# Method names should be snake case
Naming/MethodName:
EnforcedStyle: snake_case
# Use _ to make longer numbers easier to read (eg 100_000)
Style/NumericLiterals:
MinDigits: 6
# Prefer keyword arguments to options hashes.
Style/OptionHash:
SuspiciousParamNames:
- options
- opts
- args
- params
- parameters
# You don't need parens around conditionals
Style/ParenthesesAroundCondition:
AllowSafeAssignment: true
# Do not allow ; to separate several expressions on the same line.
Style/Semicolon:
AllowAsExpressionSeparator: false
# Do not allow single line methods if they have a body
Style/SingleLineMethods:
AllowIfMethodIsEmpty: true
# Only one space is used between a method name and the first argument for method
# calls without parentheses.
Layout/SpaceBeforeFirstArg:
AllowForAlignment: true
# Check for parentheses around stabby lambda arguments.
Style/StabbyLambdaParentheses:
EnforcedStyle: require_parentheses
# Require single quotes for strings that don't include interpolation
Style/StringLiterals:
EnforcedStyle: single_quotes
# Require single quotes for strings _inside_ interpolation blocks
Style/StringLiteralsInInterpolation:
EnforcedStyle: single_quotes
# Prefer `to_sym` over `intern`:
Style/StringMethods:
PreferredMethods:
intern: to_sym
# No space around block params (eg `| user |`)
Layout/SpaceAroundBlockParameters:
EnforcedStyleInsidePipes: no_space
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space
# Require space before opening brace of a block
Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space
# Require space around braces
Layout/SpaceInsideBlockBraces:
EnforcedStyle: space
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: no_space
Style/SymbolArray:
Enabled: false
Layout/TrailingEmptyLines:
EnforcedStyle: final_newline
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: no_comma
Naming/VariableName:
EnforcedStyle: snake_case
##################### Metrics ##################################
Metrics/BlockNesting:
Max: 3
Layout/LineLength:
Enabled: false
# Avoid parameter lists longer than 3 parameters.
Metrics/ParameterLists:
Max: 3
CountKeywordArgs: false