redis-key_hash 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ebc31ea112f09f727db862ad79e060886d899a1
4
- data.tar.gz: 346eec6148ba5d648b4ebac19f3d0b4d478841e8
3
+ metadata.gz: af4659873609b59ab1f7caf0280ee74603724bcd
4
+ data.tar.gz: 67795113e9239ec7697da473dbf57ae21d28c128
5
5
  SHA512:
6
- metadata.gz: 603fbb62409fa053c9cdcff1bb0fcbfad08c21371d1fc1f5256a6f4063d3a7119d310c52cf3a1861689c2ac69cddabaf93a983e49be80af484a7767a0bcbfb21
7
- data.tar.gz: d72e817eb421afe8bbee7c48c1fed69af91d497d8c91254d38925beb58e12cd69453b8082fc0147c3c99221c15d6d11495aecd6b95518c0457ae71b2a3d5920b
6
+ metadata.gz: 75bb4c2afa6697f0dadf890c020566f2f2fa739b8e643958c91f76d6c982eaf2d42277f4126ce759135314cdd9ee4c25bb42613d4b62096c8bcb50a53dcb65e0
7
+ data.tar.gz: dd77b81d539ed376e2601abf20cd3430bde9de6277ef3e82300e8923d5773b1c644ce59862c2d76f0f7ed41460241cc6b8a896f4d28707bdaf47c14cd986fda0
data/.rubocop.yml CHANGED
@@ -1,6 +1,141 @@
1
- inherit_from: .rubocop_todo.yml
1
+
2
2
  AllCops:
3
3
  Include:
4
4
  - Rakefile
5
5
  - Gemfile
6
6
  - '*.gemspec'
7
+
8
+ # Broadly speaking, test code gets a pass for most of the Metrics family.
9
+ #
10
+ # IMO test code is not the place get pedantic about class length,
11
+ # method complexity, etc. One should be encouraged to add more tests
12
+ # with minimal friction, not forced to make a hard choice between
13
+ # cutting tests or splitting up my test suites.
14
+ #
15
+ Metrics/ClassLength:
16
+ Max: 400
17
+ Exclude:
18
+ - 'test/**/*.rb'
19
+
20
+ # I like this Metric in principle, but I don't like the default max of
21
+ # 15.
22
+ #
23
+ # Also, as per Metrics/ClassLength IMO this kind of limit should not
24
+ # apply to test code (I get up to 318 over there).
25
+ #
26
+ Metrics/AbcSize:
27
+ Max: 30
28
+ Exclude:
29
+ - 'test/**/*.rb'
30
+
31
+ # I like this Metric in principle, but I don't like the default max of
32
+ # 10.
33
+ #
34
+ # Also, as per Metrics/ClassLength IMO this kind of limit should not
35
+ # apply to test code.
36
+ #
37
+ Metrics/MethodLength:
38
+ Max: 50
39
+ Exclude:
40
+ - 'test/**/*.rb'
41
+
42
+ # I put extra spaces in a lot of expressions for a lot of different
43
+ # reasons, including especially readability.
44
+ #
45
+ # I reject these cops.
46
+ #
47
+ Layout:
48
+ Enabled: false
49
+
50
+ # I like a lot of the Lint tests, but not these.
51
+ #
52
+ Lint/AmbiguousBlockAssociation: # obnoxiously rejects idiomatic Ruby
53
+ Enabled: false
54
+
55
+ # This does no more than insist I type "format" instead of "sprintf",
56
+ # where the two are aliases.
57
+ #
58
+ Style/FormatString:
59
+ Enabled: false
60
+
61
+ # There is nothing wrong with Ruby 1.9 Hash syntax.
62
+ #
63
+ Style/HashSyntax:
64
+ Enabled: false
65
+
66
+ # No. Indeed, postfix if can often drive a line over 80 columns wide.
67
+ #
68
+ Style/IfUnlessModifier:
69
+ Enabled: false
70
+
71
+ # No. There is nothing wrong with "if !foo".
72
+ #
73
+ # As far as I'm concerned, "unless" is in poor taste because it means
74
+ # I have to think in English in two different logical senses - and
75
+ # English is a poor language for logical senses.
76
+ #
77
+ Style/NegatedIf:
78
+ Enabled: false
79
+
80
+ # Too pedantic.
81
+ #
82
+ Style/NumericLiterals:
83
+ Enabled: false
84
+
85
+ # "Do not use semicolons to terminate expressions."
86
+ #
87
+ # That's great when I terminate a single-line expression with a
88
+ # redundant semicolo because I forget I'm not using C.
89
+ #
90
+ # But when I'm using a semicolon to separate two expressions there is
91
+ # no other choice. So this really ought to be Style/OneExprPerLine,
92
+ # which I reject.
93
+ #
94
+ Style/Semicolon:
95
+ Enabled: false
96
+
97
+ # No.
98
+ #
99
+ # Some lines must have '\"'. It is ugly to use a mix of '"' and '\''
100
+ # in LoCs which are close to one another. Therefore, banning '"' if
101
+ # '"' is not strictly necessary drives visual inconsistency.
102
+ #
103
+ Style/StringLiterals:
104
+ Enabled: false
105
+
106
+ # This is the same kind of obnoxious pedantry which drove Hungarian
107
+ # Notation.
108
+ #
109
+ # The [] literal syntax is perfectly servicable and there is no point
110
+ # _tightly_ coupling it to the content of the array. That's why we
111
+ # have context-free grammers!
112
+ #
113
+ Style/SymbolArray:
114
+ Enabled: false
115
+
116
+ # Shockingly, this cop requires us to *OMIT*, not *INCLUDE* parens in
117
+ # ternery conditons.
118
+ #
119
+ # IMO this one is actively harmful in that it discourages attention to
120
+ # clarity and avoiding some nasty precedence surprises.
121
+ #
122
+ Style/TernaryParentheses:
123
+ Enabled: false
124
+
125
+ # I am a huge fan of using trailing commas when I break an argument
126
+ # list down one-per line.
127
+ #
128
+ # As such, I reject this test.
129
+ #
130
+ Style/TrailingCommaInLiteral:
131
+ Enabled: false
132
+
133
+ # Too pedantic. I am starting to think I should switch from "opt out"
134
+ # to "opt in" on the Style family.
135
+ #
136
+ Style/WordArray:
137
+ Enabled: false
138
+ Style/YodaCondition:
139
+ Enabled: false
140
+ Style/ZeroLengthPredicate:
141
+ Enabled: false
@@ -1,16 +1,55 @@
1
- # Raised from Redis::KeyHash.all_in_one_slot! on a mismatch.
2
- #
3
- # Generally, this indicates we were about to risk a Redis operation
4
- # which is likely to produce a Redis error result like:
5
- #
6
- # (error) CROSSSLOT Keys in request don't hash to the same slot
7
- #
8
- # TODO: rdoc
9
- #
1
+
10
2
  class Redis
11
- class ImpendingCrossSlotError < ArgumentError # TODO: Redis::CommandError?
12
- #
13
- # TODO: capture the problems with the keys?
14
- #
3
+
4
+ # Forward declarations of Redis package errors so we can declare
5
+ # them as the parent of Redis::ImpendingCrossSlotError without
6
+ # taking a hard development or runtime dependency on the gem
7
+ # 'redis'.
8
+ #
9
+ # There remains an implicit dependency that later, when the 'redis'
10
+ # gem is loaded by the app, these declarations are consistent with
11
+ # those in the gem.
12
+ #
13
+ class BaseError < RuntimeError
15
14
  end
15
+ class CommandError < BaseError
16
+ end
17
+
18
+ # Captures the details from a potential CROSSSLOT error as
19
+ # identified by Redis::KeyHash.all_in_one_slot!.
20
+ #
21
+ # Generally, this indicates we were about to risk a Redis operation
22
+ # which is likely to produce a Redis error result like:
23
+ #
24
+ # (error) CROSSSLOT Keys in request don't hash to the same slot
25
+ #
26
+ # TODO: rdoc
27
+ #
28
+ # Redis::ImpendingCrossSlotError is a Redis::CommandError because
29
+ # the intention is to use Redis::KeyHash.all_in_one_slot! as a
30
+ # filter in front of Redis#eval, which will raise a
31
+ # Redis::CommandError when redis-server returns a CROSSSLOT error.
32
+ #
33
+ class ImpendingCrossSlotError < CommandError
34
+
35
+ def initialize(namespace,keys,namespaced_keys,problems)
36
+ err = "CROSSSLOT"
37
+ err += " namespace=#{namespace.inspect}"
38
+ err += " keys=#{keys.inspect}"
39
+ err += " namespaced_keys=#{namespaced_keys.inspect}"
40
+ err += " problems=#{problems.inspect}"
41
+ super(err)
42
+ @namespace = namespace ? namespace.dup.freeze : nil
43
+ @keys = keys.dup.freeze
44
+ @namespaced_keys = namespaced_keys.dup.freeze
45
+ @problems = problems.dup.freeze
46
+ end
47
+
48
+ attr_accessor :namespace
49
+ attr_accessor :keys
50
+ attr_accessor :namespaced_keys
51
+ attr_accessor :problems
52
+
53
+ end
54
+
16
55
  end
@@ -1,13 +1,11 @@
1
1
  require 'redis/key_hash/version'
2
2
  require 'redis/impending_cross_slot_error'
3
3
 
4
- module Redis::KeyHash
4
+ class Redis
5
5
 
6
- def self.included(base)
7
- base.extend(ClassMethods)
8
- end
9
-
10
- module ClassMethods
6
+ # Namespace for key-hashing methods.
7
+ #
8
+ class KeyHash
11
9
 
12
10
  # TODO: rdoc
13
11
 
@@ -19,12 +17,14 @@ module Redis::KeyHash
19
17
  # and is taken largely from the reference example provided in
20
18
  # http://redis.io/topics/cluster-spec.
21
19
  #
22
- :rc => /^[^{]*{([^}]+)}/, # RC uses first {}-expr, but only if nonempty
20
+ :rc => /^[^{]*{([^}]+)}/, # RC w/ first {}-expr, but only if nonempty
23
21
 
24
22
  # The :style => :rlec implementation is partly speculative. It
25
23
  # is mostly interpreted from the default RedisLabs Enterprise
26
- # Cluster documentation at
27
- # https://redislabs.com/redis-enterprise-documentation/concepts-architecture/architecture/database-clustering/,
24
+ # Cluster documentation at:
25
+ #
26
+ # https://redislabs.com/redis-enterprise-documentation/concepts-architecture/architecture/database-clustering/
27
+ #
28
28
  # plus our experience at ProsperWorks that, out of the box, RLEC
29
29
  # uses the *last* {}-expr, not the first as in RC, from :rc
30
30
  # (which we would not care about), they are also structually
@@ -66,14 +66,12 @@ module Redis::KeyHash
66
66
  # @return true if all of keys provably have the same hash_slot under
67
67
  # all styles by virtue of having a single hash_tag, false otherwise.
68
68
  #
69
- def all_in_one_slot?(*keys, namespace: nil, styles: DEFAULT_STYLES)
70
- begin
71
- all_in_one_slot!(*keys, namespace: namespace, styles: styles)
72
- rescue Redis::ImpendingCrossSlotError
73
- return false
74
- else
75
- return true
76
- end
69
+ def self.all_in_one_slot?(*keys, namespace: nil, styles: DEFAULT_STYLES)
70
+ all_in_one_slot!(*keys, namespace: namespace, styles: styles)
71
+ rescue Redis::ImpendingCrossSlotError
72
+ return false
73
+ else
74
+ return true
77
75
  end
78
76
 
79
77
  # Like all_in_one_slot?, mismatch raises Redis::ImpendingCrossSlotError.
@@ -95,21 +93,36 @@ module Redis::KeyHash
95
93
  # keys have a different hash_tag hence will not provably have the
96
94
  # same hash_slot
97
95
  #
98
- def all_in_one_slot!(*keys, namespace: nil, styles: DEFAULT_STYLES)
99
- nkeys = namespace ? keys.map { |key| "#{namespace}:#{key}" } : keys
100
- style2slot = Hash.new
101
- problems = []
96
+ def self.all_in_one_slot!(*keys, namespace: nil, styles: DEFAULT_STYLES)
97
+ namespaced_keys = keys
98
+ if namespace
99
+ #
100
+ # Although Redis::Namespace.add_namespace is private, I have
101
+ # confirmed that when namespace is the empty string, "key"
102
+ # maps to ":key".
103
+ #
104
+ # That is, namespace nil has no effect, but namespace ''
105
+ # results in a ':' prepended to every key.
106
+ #
107
+ # Naturally, this can affect the key's hash tag.
108
+ #
109
+ namespaced_keys = keys.map { |key| "#{namespace}:#{key}" }
110
+ end
111
+ problems = []
102
112
  styles.each do |style|
103
- tags = nkeys.map { |nkey| hash_tag(nkey,style: style) }.uniq
113
+ tags = namespaced_keys.map do |namespaced_key|
114
+ hash_tag(namespaced_key,style: style)
115
+ end.uniq
104
116
  next if tags.size <= 1
105
117
  problems << "style #{style} sees tags #{tags.join(',')}"
106
118
  end
107
119
  if 0 != problems.size
108
- err = "CROSSSLOT"
109
- err += " namespace=#{namespace}"
110
- err += " keys=#{keys}"
111
- err += " problems=#{problems}"
112
- raise Redis::ImpendingCrossSlotError, err
120
+ raise Redis::ImpendingCrossSlotError.new(
121
+ namespace,
122
+ keys,
123
+ namespaced_keys,
124
+ problems
125
+ )
113
126
  end
114
127
  true
115
128
  end
@@ -123,9 +136,9 @@ module Redis::KeyHash
123
136
  #
124
137
  # @param String the tag extracted from key as appropriate for :style.
125
138
  #
126
- def hash_tag(key, style: DEFAULT_STYLE)
139
+ def self.hash_tag(key, style: DEFAULT_STYLE)
127
140
  regexp = nil
128
- if KNOWN_STYLES.has_key?(style)
141
+ if KNOWN_STYLES.key?(style)
129
142
  regexp = KNOWN_STYLES[style] # some are predefined
130
143
  elsif style.is_a?(Regexp)
131
144
  regexp = style # you can define your own
@@ -134,7 +147,7 @@ module Redis::KeyHash
134
147
  raise ArgumentError, "bogus style #{style}"
135
148
  end
136
149
  match = regexp.match(key)
137
- return match ? match[1] : key
150
+ match ? match[1] : key
138
151
  end
139
152
 
140
153
  # Computes the Redis hash_slot for a given key.
@@ -153,7 +166,7 @@ module Redis::KeyHash
153
166
  #
154
167
  # @param non-negative Integer the hash which Redis will use to slot key
155
168
  #
156
- def hash_slot(key, style: DEFAULT_STYLE)
169
+ def self.hash_slot(key, style: DEFAULT_STYLE)
157
170
  tag = hash_tag(key, style: style)
158
171
  crc16(tag) % 16384
159
172
  end
@@ -169,10 +182,10 @@ module Redis::KeyHash
169
182
  # @param non-negative Integer the crc16 which Redis will use to
170
183
  # compute a hash_key.
171
184
  #
172
- def crc16(key)
185
+ def self.crc16(key)
173
186
  crc = 0
174
187
  key.each_char do |char|
175
- crc = ((crc << 8) & 0xFFFF) ^ CRC16TAB[((crc >> 8) ^ char.ord) & 0x00FF]
188
+ crc = ((crc<<8) & 0xFFFF) ^ CRC16TAB[((crc>>8) ^ char.ord) & 0x00FF]
176
189
  end
177
190
  crc
178
191
  end
@@ -1,5 +1,5 @@
1
1
  class Redis
2
- module KeyHash
2
+ class KeyHash
3
3
  #
4
4
  # Version plan/history:
5
5
  #
@@ -10,11 +10,24 @@ class Redis
10
10
  # 0.0.3 - Fix :rc to match https://redis.io/topics/cluster-spec,
11
11
  # added Rubocop checks.
12
12
  #
13
+ # 0.0.4 - Verified existing behavior w/r/t Redis::Namespace.
14
+ #
15
+ # Added more details in Redis::ImpendingCrossSlotError.
16
+ #
17
+ # Rubocop polish and defiance.
18
+ #
19
+ # Redis::KeyHash::ClassMethods inner-inner class removed.
20
+ #
21
+ # Redis::KeyHash changed to a class, not a module.
22
+ #
23
+ # Redis::ImpendingCrossSlotError changed from
24
+ # ArgumentError to Redis::RuntimeError.
25
+ #
13
26
  # 0.1.0 - (future) Big README.md and Rdoc update, solicit feedback
14
27
  # from select external beta users.
15
28
  #
16
29
  # 0.2.0 - (future) Incorporate feedback, announce.
17
30
  #
18
- VERSION = '0.0.3'
31
+ VERSION = '0.0.4'.freeze
19
32
  end
20
33
  end
@@ -11,10 +11,8 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = 'Tests Redis Cluster key hash slot agreement'
13
13
  spec.homepage = 'https://github.com/ProsperWorks/redis-key_hash'
14
- spec.description = %{
15
- redis-key_hash provides tests of key hash slot agreement for use with
16
- Redis Cluster and RedisLabs Enterprise Cluster.
17
- }
14
+ spec.description =
15
+ 'Hash slot tests for Redis Cluster and RedisLabs Enterprise Cluster.'
18
16
 
19
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
18
  f.match(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-key_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jhwillett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-29 00:00:00.000000000 Z
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,10 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.10'
55
- description: |2
56
-
57
- redis-key_hash provides tests of key hash slot agreement for use with
58
- Redis Cluster and RedisLabs Enterprise Cluster.
55
+ description: Hash slot tests for Redis Cluster and RedisLabs Enterprise Cluster.
59
56
  email:
60
57
  - jhw@prosperworks.com
61
58
  executables: []
@@ -64,7 +61,6 @@ extra_rdoc_files: []
64
61
  files:
65
62
  - ".gitignore"
66
63
  - ".rubocop.yml"
67
- - ".rubocop_todo.yml"
68
64
  - ".travis.yml"
69
65
  - Gemfile
70
66
  - LICENSE
data/.rubocop_todo.yml DELETED
@@ -1,214 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2017-08-29 14:52:28 -0700 using RuboCop version 0.49.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 2
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: EnforcedStyle, SupportedStyles.
12
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
13
- Layout/EmptyLinesAroundClassBody:
14
- Exclude:
15
- - 'test/redis/key_hash_test.rb'
16
-
17
- # Offense count: 4
18
- # Cop supports --auto-correct.
19
- # Configuration parameters: EnforcedStyle, SupportedStyles.
20
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
21
- Layout/EmptyLinesAroundModuleBody:
22
- Exclude:
23
- - 'lib/redis/key_hash.rb'
24
-
25
- # Offense count: 273
26
- # Cop supports --auto-correct.
27
- # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
28
- Layout/ExtraSpacing:
29
- Exclude:
30
- - 'lib/redis/key_hash.rb'
31
- - 'test/redis/key_hash_test.rb'
32
-
33
- # Offense count: 290
34
- # Cop supports --auto-correct.
35
- Layout/SpaceAfterComma:
36
- Exclude:
37
- - 'lib/redis/key_hash.rb'
38
- - 'test/redis/key_hash_test.rb'
39
-
40
- # Offense count: 7
41
- # Cop supports --auto-correct.
42
- # Configuration parameters: AllowForAlignment.
43
- Layout/SpaceAroundOperators:
44
- Exclude:
45
- - 'lib/redis/key_hash.rb'
46
- - 'test/redis/key_hash_test.rb'
47
-
48
- # Offense count: 104
49
- # Cop supports --auto-correct.
50
- Layout/SpaceInsideBrackets:
51
- Exclude:
52
- - 'lib/redis/key_hash.rb'
53
- - 'test/redis/key_hash_test.rb'
54
-
55
- # Offense count: 1
56
- Lint/UselessAssignment:
57
- Exclude:
58
- - 'lib/redis/key_hash.rb'
59
-
60
- # Offense count: 2
61
- Metrics/AbcSize:
62
- Max: 31
63
-
64
- # Offense count: 1
65
- # Configuration parameters: CountComments.
66
- Metrics/ClassLength:
67
- Max: 2228
68
-
69
- # Offense count: 9
70
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
71
- # URISchemes: http, https
72
- Metrics/LineLength:
73
- Max: 82
74
-
75
- # Offense count: 3
76
- # Configuration parameters: CountComments.
77
- Metrics/MethodLength:
78
- Max: 35
79
-
80
- # Offense count: 1
81
- # Configuration parameters: EnforcedStyle, SupportedStyles.
82
- # SupportedStyles: nested, compact
83
- Style/ClassAndModuleChildren:
84
- Exclude:
85
- - 'lib/redis/key_hash.rb'
86
-
87
- # Offense count: 2
88
- Style/Documentation:
89
- Exclude:
90
- - 'spec/**/*'
91
- - 'test/**/*'
92
- - 'lib/redis/key_hash.rb'
93
-
94
- # Offense count: 1
95
- # Cop supports --auto-correct.
96
- Style/EmptyLiteral:
97
- Exclude:
98
- - 'lib/redis/key_hash.rb'
99
-
100
- # Offense count: 3
101
- # Cop supports --auto-correct.
102
- # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
103
- # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
104
- Style/HashSyntax:
105
- Exclude:
106
- - 'Rakefile'
107
- - 'lib/redis/key_hash.rb'
108
-
109
- # Offense count: 1
110
- # Cop supports --auto-correct.
111
- # Configuration parameters: MaxLineLength.
112
- Style/IfUnlessModifier:
113
- Exclude:
114
- - 'lib/redis/key_hash.rb'
115
-
116
- # Offense count: 1
117
- # Configuration parameters: SupportedStyles.
118
- # SupportedStyles: snake_case, camelCase
119
- Style/MethodName:
120
- EnforcedStyle: snake_case
121
-
122
- # Offense count: 1
123
- # Cop supports --auto-correct.
124
- Style/MutableConstant:
125
- Exclude:
126
- - 'lib/redis/key_hash/version.rb'
127
-
128
- # Offense count: 1
129
- # Cop supports --auto-correct.
130
- # Configuration parameters: EnforcedStyle, SupportedStyles.
131
- # SupportedStyles: both, prefix, postfix
132
- Style/NegatedIf:
133
- Exclude:
134
- - 'lib/redis/key_hash.rb'
135
-
136
- # Offense count: 10
137
- # Cop supports --auto-correct.
138
- # Configuration parameters: Strict.
139
- Style/NumericLiterals:
140
- MinDigits: 6
141
-
142
- # Offense count: 1
143
- # Cop supports --auto-correct.
144
- # Configuration parameters: PreferredDelimiters.
145
- Style/PercentLiteralDelimiters:
146
- Exclude:
147
- - 'redis-key_hash.gemspec'
148
-
149
- # Offense count: 1
150
- # Cop supports --auto-correct.
151
- # Configuration parameters: EnforcedStyle, SupportedStyles.
152
- # SupportedStyles: short, verbose
153
- Style/PreferredHashMethods:
154
- Exclude:
155
- - 'lib/redis/key_hash.rb'
156
-
157
- # Offense count: 1
158
- # Cop supports --auto-correct.
159
- Style/RedundantBegin:
160
- Exclude:
161
- - 'lib/redis/key_hash.rb'
162
-
163
- # Offense count: 1
164
- # Cop supports --auto-correct.
165
- # Configuration parameters: AllowMultipleReturnValues.
166
- Style/RedundantReturn:
167
- Exclude:
168
- - 'lib/redis/key_hash.rb'
169
-
170
- # Offense count: 16410
171
- # Cop supports --auto-correct.
172
- # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
173
- # SupportedStyles: single_quotes, double_quotes
174
- Style/StringLiterals:
175
- Exclude:
176
- - 'Rakefile'
177
- - 'bin/console'
178
- - 'lib/redis/key_hash.rb'
179
- - 'redis-key_hash.gemspec'
180
- - 'test/redis/key_hash_test.rb'
181
-
182
- # Offense count: 1
183
- # Cop supports --auto-correct.
184
- # Configuration parameters: MinSize, SupportedStyles.
185
- # SupportedStyles: percent, brackets
186
- Style/SymbolArray:
187
- EnforcedStyle: brackets
188
-
189
- # Offense count: 3
190
- # Cop supports --auto-correct.
191
- # Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
192
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
193
- Style/TrailingCommaInLiteral:
194
- Exclude:
195
- - 'test/redis/key_hash_test.rb'
196
-
197
- # Offense count: 7
198
- # Cop supports --auto-correct.
199
- # Configuration parameters: SupportedStyles, MinSize, WordRegex.
200
- # SupportedStyles: percent, brackets
201
- Style/WordArray:
202
- EnforcedStyle: brackets
203
-
204
- # Offense count: 1
205
- # Cop supports --auto-correct.
206
- Style/YodaCondition:
207
- Exclude:
208
- - 'lib/redis/key_hash.rb'
209
-
210
- # Offense count: 1
211
- # Cop supports --auto-correct.
212
- Style/ZeroLengthPredicate:
213
- Exclude:
214
- - 'lib/redis/key_hash.rb'