-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
139 lines (123 loc) · 5.28 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
inherit_from: .rubocop_todo.yml
require: rubocop-rails
#########################################################
# I ignore block and method length rules. My reasonings:
# - I would prefer to see block and method length rules as only a reminder to consider refactoring.
# - Block and method length rules are incompatible with declarative programming approaches
# - we are not outlawing declarative programming, right?
# - Block and method length rules cause scattering of code. Code should be kept together when:
# - we want to keep related thoughts together.
# - we want to see the program flow right in front of us;
# - when it does not need to be refactored
# - I recommend never refactoring until you have two or more code blocks to work with;
# - the block and method length rules will cause code to be refactored too early.
# - If the reason for these rules is for readable and comprehensible code, then set up rules for that instead.
# - There are problems when when block and method length rules are combined with line length rules:
# - it discourages descriptive variable naming (extremely important aspect of readability);
# - it discourages splitting method call parameters being split into multiple lines (helps in readability);
Metrics/BlockLength:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
#########################################################
# I ignore line length rules. My reasonings:
# - I would prefer to see line length rules as only a reminder to:
# - break comments into single thoughts
# - place parameters on separate lines, which could allow for additional comments.
# - Line length rules are a problem when combined with block and method length rules, because:
# - it discourages descriptive variable naming (extremely important aspect of readability);
# - it discourages splitting method call parameters being split into multiple lines (helps in readability);
# - Discourages keeping things that belong together, together # I don't care if you dislike this english, it is comprehensible, and I am keeping it and this comment on the same line, because it is a consistent thought in one bullet point. Maybe I might put child bullet points, but then it would take more lines. set up wrapping on your editor.
Layout/LineLength:
Enabled: false
#########################################################
# prevent comments from getting this error
Style/FrozenStringLiteralComment:
Enabled: false
#########################################################
# prevent rubocop from indenting code extremely deeply (making long lines)
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
# Layout/HashAlignment:
#########################################################
# prevent rubocop hiding empty methods that do not have comments yet
Style/EmptyMethod:
EnforcedStyle: expanded
#########################################################
# allow any kind of spacing around code for readability
# sometimes spacing helps separate out lines of code that belong together
Layout/EmptyLinesAroundClassBody:
Enabled: false
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Enabled: false
Layout/EmptyLinesAroundMethodBody:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EmptyLinesAroundAccessModifier:
Enabled: false
Layout/EmptyLinesAroundArguments:
Enabled: false
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/ExtraSpacing:
Enabled: false
#########################################################
# try to be more explicit in coding
Style/DefWithParentheses:
Enabled: false
Style/MethodCallWithoutArgsParentheses:
Enabled: false
Style/RedundantReturn:
Enabled: false
Style/HashSyntax:
EnforcedShorthandSyntax: never
Style/RedundantSelf:
Enabled: false
Style/TernaryParentheses:
EnforcedStyle: require_parentheses
Style/EmptyElse:
Enabled: false
#########################################################
# allow comma in last argument
# - especially when in separate lines for Version Control change detection)
Style/TrailingCommaInArguments:
Enabled: false
Style/TrailingCommaInHashLiteral:
Enabled: false
Style/TrailingCommaInArrayLiteral:
Enabled: false
#########################################################
# remove fussiness about double and single quotes
Style/StringLiteralsInInterpolation:
Enabled: false
Style/StringLiterals:
Enabled: false
#########################################################
# do not force trailing 'if' on single line condition
Style/IfUnlessModifier:
Enabled: false
Style/GuardClause:
Enabled: false
#########################################################
# do not force the use of 'unless'
Style/NegatedIf:
Enabled: false
#########################################################
# do not force .positive? for > 0 (I think it is quite readable)
Style/NumericPredicate:
Enabled: false
#########################################################
# no space in defining parameters.
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
#########################################################
# Allow setting to STDOUT, not the current rails $stdout
Style/GlobalStdStream:
Enabled: false