-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy path.rubocop.yml
122 lines (96 loc) · 3.01 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
require:
- rubocop-rake
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Include
AllCops:
TargetRubyVersion: 2.2
Include:
- '**/Gemfile.*'
Exclude:
- '**/Gemfile*.lock'
NewCops: enable
# Even the reference in the documentation suggests that you should prefer
# `alias_method` vs `alias`, so I don't understand why that isn't the default.
Style/Alias:
EnforcedStyle: prefer_alias_method
Style/Documentation:
Enabled: false
# Kernel#__dir__ has only been available since Ruby v2.0
Style/ExpandPathArguments:
Enabled: false
# I'm not keen on this cop, because it's easy to miss the conditional
# I think the results are particularly unhelpful when Metrics/LineLength is big
Style/IfUnlessModifier:
Enabled: false
# Lambda literal syntax has only been supported since Ruby v2.0
Style/Lambda:
EnforcedStyle: lambda
# Symbol array literal syntax has only been supported since Ruby v2.0
Style/SymbolArray:
Enabled: false
# I'm not keen on this cop, because it's easy to miss the while/until
Style/WhileUntilModifier:
Enabled: false
# This recently introduced cop seems to have stirred up some controversy
Style/AccessModifierDeclarations:
Enabled: false
# `Module#===` is useful in presence of objects such as mocks
# that may have a `is_a?` implementation that lies.
Style/CaseEquality:
Enabled: false
# This is useful when using `ExecutionPoint.current` to make tests more robust
Style/Semicolon:
Enabled: false
# Enabling this cop results in an "Infinite loop detected" exception
Layout/AccessModifierIndentation:
Enabled: false
# Allow long comment lines, e.g. YARD documentation
Layout/LineLength:
AllowedPatterns: ['\A\s*#']
# It's not possible to set TargetRubyVersion to Ruby < v2.2
Gemspec/RequiredRubyVersion:
Enabled: false
# It can be useful to violate this cop in tests in order to be more explicit
Lint/UselessTimes:
Exclude:
- 'test/**/*.rb'
# It can be useful to violate this cop in tests
Lint/EmptyClass:
Exclude:
- 'test/**/*.rb'
# It can be useful to violate this cop in tests when testing methods that accept a block
Lint/EmptyBlock:
Exclude:
- 'test/**/*.rb'
# There are a mix of styles in the tests and so I don't think it's worth enforcing for now
Naming/VariableNumber:
Exclude:
- 'test/**/*.rb'
# These methods from Ruby core are legitimately overridden in the tests
Style/OptionalBooleanParameter:
AllowedMethods:
- respond_to?
- public_methods
- protected_methods
- private_methods
- public_instance_methods
- protected_instance_methods
- private_instance_methods
# This cop is useful for required environment variables, but not for optional ones
Style/FetchEnvVar:
AllowedVars:
- MOCHA_RUN_INTEGRATION_TESTS
Naming/FileName:
ExpectMatchingDefinition: true
CheckDefinitionPathHierarchyRoots:
- test/unit
- test/acceptance
Exclude:
- lib/mocha/version.rb
- lib/mocha/minitest.rb
- lib/mocha/test_unit.rb
- lib/mocha/ruby_version.rb
- lib/mocha/macos_version.rb
- test/test_helper.rb