rubocop-redis-rb 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: fe550152ecf81619ed0e691bd8c4bbdee5229750a314a1e5d78b516c9eee1124
4
- data.tar.gz: 271ec1e371f4b2c6b0105c7f253656cbc11ea3abb93cf07cd8255c875815ec01
3
+ metadata.gz: 7b9e4b222abae977aa73387013d5ed9949366a3569402bc351a4c3429fffb6cb
4
+ data.tar.gz: bff174b3b5462031a3eed8f1e78616775a60929481c2fcdcc81fcc21000c1213
5
5
  SHA512:
6
- metadata.gz: cdcaf1bc97f592960b223839be53fb5e7217a75b22e09464e581a7491662c72254c0cb9e6f5001e4e7f8830313b4f59229d5fcfe678c24a92b8c5241d9ae2da3
7
- data.tar.gz: 6c922aa5ab402f0c05e7b58e59a0b14befa81f5b13222c89036f13a2c5c9c9b68b9752d1c5657fad5047226067bd858334f436b71de4598f20455b74715d8fca
6
+ metadata.gz: 07dd91c077f94143595afb82f3541bc2ba03a4d66458e90b687351a64c8dde1b5df655503ecc5130fda524454d655de24c1c2ff415150ccf9c9e454323d9dfa3
7
+ data.tar.gz: dd9477b200a4914c92469622d897b6e83d6cdcee5edf79e22f82ef563599201b7c5c92c26f5cde8760ef5018ab3e4d39203cf58d8c88f0da8cedc0abbdf7ac58
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-redis-rb (0.1.0)
4
+ rubocop-redis-rb (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,6 @@
1
+ # This is the default configuration file.
2
+
3
+ Redis/NotKeys:
4
+ Description: "Do not use `.keys`. It may ruin performance when it is executed against large databases. See https://redis.io/commands/keys/ for details."
5
+ Enabled: true
6
+ VersionAdded: "0.1"
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module RedisRb
5
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
6
+ # bit of our configuration.
7
+ module Inject
8
+ def self.defaults!
9
+ project_root = Pathname.new(__dir__).parent.parent.parent.expand_path
10
+ config_default = project_root.join('config', 'default.yml')
11
+ path = config_default.to_s
12
+ hash = ConfigLoader.send(:load_yaml_configuration, path)
13
+ config = RuboCop::Config.new(hash, path)
14
+ puts "configuration from #{path}" if ConfigLoader.debug?
15
+ config = ConfigLoader.merge_with_default(config, path)
16
+ ConfigLoader.instance_variable_set(:@default_configuration, config)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubocop
4
4
  module RedisRb
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'rubocop'
4
4
  require_relative "rubocop/redis-rb/version"
5
+ require_relative "rubocop/redis-rb/inject"
5
6
 
6
7
  module Rubocop
7
8
  module RedisRb
@@ -10,4 +11,6 @@ module Rubocop
10
11
  end
11
12
  end
12
13
 
14
+ RuboCop::RedisRb::Inject.defaults!
15
+
13
16
  require_relative 'rubocop/cop/redis-rb_cops'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-redis-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 9sako6
@@ -23,10 +23,12 @@ files:
23
23
  - Gemfile.lock
24
24
  - README.md
25
25
  - Rakefile
26
+ - config/default.yml
26
27
  - lib/rubocop-redis-rb.rb
27
28
  - lib/rubocop/cop/redis-rb/not_keys.rb
28
29
  - lib/rubocop/cop/redis-rb_cops.rb
29
30
  - lib/rubocop/redis-rb.rb
31
+ - lib/rubocop/redis-rb/inject.rb
30
32
  - lib/rubocop/redis-rb/version.rb
31
33
  - rubocop-redis-rb.gemspec
32
34
  homepage: https://github.com/9sako6/rubocop-redis-rb