rubocop-sequel 0.3.0 → 0.3.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: 260beb7a94809075be127b7eac43b03b1acc661038009ea8c189bb91f543bdf0
4
- data.tar.gz: '0815a252def8ee363d59bdc19f8c317b8f68bf9a89a50ed15bd79730bbc9fa60'
3
+ metadata.gz: c2050311f0798d72d81f8af6463c505abbed45460abf2c6b764b90a57fc4926f
4
+ data.tar.gz: 9b2dac1b9e05c5d47e8ce64386357c3fd1f73a46cd057e6e598923508e6d3bb4
5
5
  SHA512:
6
- metadata.gz: fa012f6644b9360e4d3d8c3d9ceb1b00165bab142f6dab7521d7289a8caa09704b6d27224cae6490b9a86067a7058bd657ac59f975c51e242807d65243678b3a
7
- data.tar.gz: 19aa510cdf0b8ec211d1bca4377652afa877a7c4e52d8804a45099008d0a763c008dac616b15e5074e71bbe98800d5c3d54f98fde5dc1fd29600ca197a6233ea
6
+ metadata.gz: 25c86a24a2f3d7c72259ca824b7f3f49c09307f81aacca96b1ca265a6ac63038afa50355542b2896e058a0b04b3b4f3ba897dcbf824026f9d8be2e7c7255c042
7
+ data.tar.gz: ba02ad3c73e81769d1bcf5642f15b02ba006319d507566a5ad2fabfa49681c006b0305d72ea76a7393b273a3b5434aec3baec20093deb8b43f4258591a7086e3
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Sequel
6
6
  # PartialConstraint looks for missed usage of partial indexes.
7
- class PartialConstraint < Cop
7
+ class PartialConstraint < Base
8
8
  MSG = "Constraint can't be partial, use where argument with index"
9
9
 
10
10
  def_node_matcher :add_partial_constraint?, <<-MATCHER
@@ -14,7 +14,7 @@ module RuboCop
14
14
  def on_send(node)
15
15
  return unless add_partial_constraint?(node)
16
16
 
17
- add_offense(node, location: :selector, message: MSG)
17
+ add_offense(node.loc.selector, message: MSG)
18
18
  end
19
19
  end
20
20
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = 'rubocop-sequel'
15
15
  gem.require_paths = ['lib']
16
- gem.version = '0.3.0'
16
+ gem.version = '0.3.1'
17
17
 
18
18
  gem.required_ruby_version = '>= 2.5'
19
19
 
@@ -6,10 +6,10 @@ describe RuboCop::Cop::Sequel::PartialConstraint do
6
6
  subject(:cop) { described_class.new }
7
7
 
8
8
  it 'registers an offense when using where for constraint' do
9
- inspect_source <<-RUBY
9
+ offenses = inspect_source(<<~RUBY)
10
10
  add_unique_constraint %i[col_1 col_2], where: "state != 'deleted'"
11
11
  RUBY
12
12
 
13
- expect(cop.offenses.size).to eq(1)
13
+ expect(offenses.size).to eq(1)
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timothée Peignier