-
Notifications
You must be signed in to change notification settings - Fork 14
/
.rubocop.yml
143 lines (110 loc) · 3.37 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
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude
- CountAsOne
require:
- rubocop-minitest
- rubocop-packaging
- rubocop-performance
AllCops:
Exclude:
- 'examples/*'
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
# Spaces in strings with line continuations go at the beginning of the line.
Layout/LineContinuationLeadingSpace:
EnforcedStyle: leading
# 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
# Force consistent spacing independent of block contents
Layout/SpaceBeforeBlockBraces:
EnforcedStyleForEmptyBraces: space
# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
# Assume the programmer knows precendence rules
Lint/AmbiguousOperatorPrecedence:
Enabled: false
# Allow if (foo = get_foo) style
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# Test describe blocks, rake task namespaces, and gem specification blocks can be any size
Metrics/BlockLength:
Exclude:
- 'test/**/*'
- 'tasks/*.rake'
- '*.gemspec'
# Count certain literals as only one line of code
Metrics/MethodLength:
CountAsOne:
- heredoc
# Allow semantic variation in and/or external determination of symbols
Naming/VariableNumber:
CheckSymbols: false
Performance/StartWith:
AutoCorrect: true
# Use alias_method since it is more versatile
Style/Alias:
EnforcedStyle: prefer_alias_method
# Allow and/or for control flow only
Style/AndOr:
EnforcedStyle: conditionals
# Require at least two dependent lines before suggesting a guard clause
Style/GuardClause:
MinBodyLength: 2
# Sometimes an if statement just looks better than next with a guard clause
Style/Next:
Enabled: false
# Allow both real comparison and predicate methods
Style/NumericPredicate:
Enabled: false
# Allow explicit return with multiple return values
Style/RedundantReturn:
AllowMultipleReturnValues: 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
# Disable to allow free choice
Style/SuperWithArgsParentheses:
Enabled: false
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets
# Accessors are only trivial if they match the ivar name.
# Also, allow accessors with ? in the name.
Style/TrivialAccessors:
ExactNameMatch: true
AllowPredicates: true
# Project-specific configuration goes here.
# GObject has a lot of accessor method starting with get_ or set_
Naming/AccessorMethodName:
Enabled: false
# GirFFI uses a gir_ffi-something naming scheme.
Naming/FileName:
Enabled: false
# TODO: See about has_ and have_
Naming/PredicateName:
ForbiddenPrefixes:
- is_
# In tests, we want to do this to be more clear
Performance/FixedSize:
Exclude:
- 'test/**/*.rb'