forked from marketplacer/barcodevalidation
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.rubocop.yml
106 lines (81 loc) · 2.18 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
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Include:
- 'Gemfile'
- 'Rakefile'
- 'config/*'
- '*.gemspec'
- '**/*.rb'
Exclude:
- .bundle/**/*
- bin/bundle
- bin/console
- bin/rake
- bin/rspec
- bin/rubocop
- bin/setup
- vendor/**/*
TargetRubyVersion: 2.5
# Single-quotes aren't quotes, they're apostrophes! D:
Style/StringLiterals:
EnforcedStyle: double_quotes
# Disabled due to noise when re-opening modules
Style/Documentation:
Enabled: false
# Enable some cops disabled by default in the standard Rubocop config
# These are all the cops that are disabled normally.
# Suggests the usage of an auto resource cleanup version of a method
# (if available).
Style/AutoResourceCleanup:
Enabled: true
# Preferred collection methods
Style/CollectionMethods:
Enabled: true
# Avoid if/case expressions with empty else branches
Style/MissingElse:
Enabled: true
# Avoid chaining a method call on a do...end block
Style/MethodCalledOnDoEndBlock:
Enabled: true
# Do not assign mutable objects to constants
Style/MutableConstant:
Enabled: true
# Don't use option hashes when you can use keyword arguments
Style/OptionHash:
Enabled: true
# Prefer `Object#__send__` or `Object#public_send` to `send`, as
# `send` may overlap with existing methods.
Style/Send:
Enabled: true
# Use %i or %I for arrays of symbols
Style/SymbolArray:
Enabled: true
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
# Tighten up the metrics
Metrics/AbcSize:
Max: 15 # Rubocop default: 15
Metrics/BlockLength:
Exclude:
- spec/**/* # DSL is block-heavy
Metrics/BlockNesting:
Max: 2 # Rubocop default: 3
Metrics/ClassLength:
Max: 100 # Rubocop default: 100
Metrics/ModuleLength:
Max: 30 # Rubocop default: 100
Metrics/CyclomaticComplexity:
Max: 5 # Rubocop default: 6
Metrics/LineLength:
Max: 180 # Rubocop default: 80
Metrics/MethodLength:
Max: 10 # Rubocop default: 10
Metrics/ParameterLists:
Max: 2 # Rubocop default: 5
Metrics/PerceivedComplexity:
Max: 3 # Rubocop default: 7