forked from rubyzip/rubyzip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
84 lines (68 loc) · 1.97 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
inherit_from: .rubocop_todo.yml
# Set this to the minimum supported ruby in the gemspec. Otherwise
# we get errors if our ruby version doesn't match.
AllCops:
TargetRubyVersion: 2.4
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
# Set a workable line length, given the current state of the code,
# and turn off for the tests.
Layout/LineLength:
Max: 135
Exclude:
- 'test/**/*.rb'
# In some cases we just need to catch an exception, rather than
# actually handle it. Allow the tests to make use of this shortcut.
Lint/SuppressedException:
AllowComments: true
Exclude:
- 'test/**/*.rb'
# Allow this "useless" test, as we are testing <=> here.
Lint/UselessComparison:
Exclude:
- 'test/entry_test.rb'
# Turn off ABC metrics for the tests and set a workable max given
# the current state of the code.
Metrics/AbcSize:
Max: 37
Exclude:
- 'test/**/*.rb'
# Turn block length metrics off for the tests.
Metrics/BlockLength:
Exclude:
- 'test/**/*.rb'
# Turn class length metrics off for the tests.
Metrics/ClassLength:
Exclude:
- 'test/**/*.rb'
# Turn method length metrics off for the tests.
Metrics/MethodLength:
Exclude:
- 'test/**/*.rb'
# Set a consistent way of checking types.
Style/ClassCheck:
EnforcedStyle: kind_of?
Style/HashEachMethods:
Enabled: true
Style/HashTransformValues:
Enabled: true
# Allow this multi-line block chain as it actually reads better
# than the alternatives.
Style/MultilineBlockChain:
Exclude:
- 'lib/zip/crypto/traditional_encryption.rb'
# Allow inner slashes when using // for regex literals. Allow the
# Guardfile to use a syntax that is more consistent with its own style.
Style/RegexpLiteral:
AllowInnerSlashes: true
Exclude:
- 'Guardfile'
Style/SymbolArray:
EnforcedStyle: brackets
# Turn this cop off for these files as it fires for objects without
# an empty? method.
Style/ZeroLengthPredicate:
Exclude:
- 'lib/zip/file.rb'
- 'lib/zip/input_stream.rb'