forked from quix/live_ast
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.rubocop.yml
154 lines (121 loc) · 3.46 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
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude
require:
- rubocop-minitest
- rubocop-packaging
- rubocop-performance
- rubocop-rake
AllCops:
Exclude:
- 'test/encoding_test/*.rb'
- 'devel/levitate.rb'
- 'devel/levitate_config.rb'
NewCops: enable
TargetRubyVersion: 3.0
# Put development dependencies in the gemspec so rubygems.org knows about them
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
# Make BeginEndAlignment behavior match EndAlignment
Layout/BeginEndAlignment:
EnforcedStyleAlignWith: begin
# Be lenient with line length
Layout/LineLength:
Max: 92
# Don't force lonely closing parentheses
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: same_line
# Multi-line method calls should be simply indented. Aligning them makes it
# even harder to keep a sane line length.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Multi-line assignment should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Force consistent spacing independent of block contents
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
# Tests use blocks that define constants
Lint/ConstantDefinitionInBlock:
Exclude:
- 'test/**/*'
# Needed for `unfixable` in tests
Lint/SuppressedException:
Exclude:
- 'test/**/*'
# LiveAST sometimes needs to rescue all exceptions
Lint/RescueException:
Enabled: false
# Allow test classes to have any length
Metrics/ClassLength:
Exclude:
- 'test/**/*'
# Allow use of eval in tests (that is sort of the point!)
Security/Eval:
Exclude:
- 'test/**/*'
# Allow and/or for control flow only
Style/AndOr:
EnforcedStyle: conditionals
# Allow multi-line blocks of all sorts
Style/BlockDelimiters:
Enabled: false
# Allow def A.foo in tests
Style/ClassMethods:
Exclude:
- 'test/**/*'
# Stack trace is less important in tests
# TODO: Look into details later
Style/EvalWithLocation:
Exclude:
- 'test/**/*'
# Stop this cop from complaining about us-ascii encoding
Style/Encoding:
Exclude:
- 'lib/live_ast/reader.rb'
# Require at least two dependent lines before suggesting a guard clause
Style/GuardClause:
MinBodyLength: 2
# Allow both lambda syntaxes in tests
Style/Lambda:
Exclude:
- 'test/**/*'
# This test requires its constant to be mutable
Style/MutableConstant:
Exclude:
- 'test/full/replace_eval_test.rb'
# Sometimes an if statement just looks better than next with a guard clause
Style/Next:
Enabled: false
# Use {} for %-literals, and revert to previous RuboCop default for %w
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%': '{}'
'%w': ()
# Allow Proc.new in tests
Style/Proc:
Exclude:
- 'test/**/*'
# Allow explicit return with multiple return values
Style/RedundantReturn:
AllowMultipleReturnValues: true
# Allow multiple expressions per line
Style/Semicolon:
AllowAsExpressionSeparator: true
# Do not commit to use of interpolation
Style/StringLiterals:
EnforcedStyle: double_quotes
# Make quoting outside and inside interpolation consistent
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets