-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.rubocop.yml
86 lines (75 loc) · 2.33 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
AllCops:
# The oldest version of Ruby supported by this gem
TargetRubyVersion: 2.3
# Gotta catch 'em all!
NewCops: enable
# These linters are not enabled by default
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# These help with readability
Layout/CaseIndentation:
Enabled: false
Layout/EmptyLines:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines
Exclude:
- 'testing/rspec/spec/**/*' # Specs tend to just have little monkey patches that don't need the extra room
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/LineLength:
Max: 120
Naming/VariableNumber:
EnforcedStyle: snake_case
Metrics/BlockLength:
Exclude:
- 'testing/rspec/spec/**/*' # RSpec tests are inherently large blocks of code
- 'cuke_modeler.gemspec' # As is a gemspec
# If Ruby suddenly changes, that's its fault.
Style/FrozenStringLiteralComment:
Enabled: false
# Non-specific exception handling is fine
Style/RescueStandardError:
EnforcedStyle: 'implicit'
# This would result in too much intermixing of regular and percent arrays, depending on
# context, and makes nested arrays look weird
Style/SymbolArray:
Enabled: false
Style/WordArray:
Enabled: false
# Still within understanding as long as other complexity cops aren't triggering
Metrics/MethodLength:
Max: 15
# I'd rather not have to mix `{}` and `do...end` blocks for `let` statements just to keep RuboCop happy
Layout/BlockEndNewline:
Exclude:
- 'testing/rspec/spec/**/*'
Layout/MultilineBlockLayout:
Exclude:
- 'testing/rspec/spec/**/*'
Style/BlockDelimiters:
Exclude:
- 'testing/rspec/spec/**/*'
Security/Eval:
Exclude:
- 'testing/**/*' # Test code is a safe enough place to use 'eval'
Layout/HashAlignment:
EnforcedHashRocketStyle: table
# The gemspec is the source of truth for a gem. Also, enough wacky things happen in this
# project's gemfiles that we don't need more stuff going in there.
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
# Additionally, easily distinguishing between runtime and development dependencies is important
# when they live in the same place.
Gemspec/AddRuntimeDependency:
Enabled: false