rubocop-sequel 0.3.8 → 0.4.0

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: 43689260646cb1428cd6629924d01648a005939d8f1094a6fcbb88ecc1a7fc68
4
- data.tar.gz: b95f6400f9d2857ac7ce9d32c8931a71db14ba6e8cd86e128289fe1ef836d95b
3
+ metadata.gz: a2d09b1a9e96d359603f2f32bb8a0db799c0492b162eeac2db55f7fb28cdb909
4
+ data.tar.gz: 0a09867eff4ba23036a30003bcc0ce4350fe1d1be605eeedc7134e51650fb712
5
5
  SHA512:
6
- metadata.gz: a78387c550cc09564f2fffee05a5dda77c370130dd41f9c8b8a0f8bb26683813b97c1c2540250574c95ae7a192743d1873f59b82cdf02de501ff1d679a029bb5
7
- data.tar.gz: 2e91b8df57f918c221d2d2319037264d347b84eaa082ed6f378d85f5023f9b6bcf19a5b2854553cc56707e986551c9bf5dd2ff1f17aaa1e04a3e5bd7c94221a9
6
+ metadata.gz: 84d837517a27a61c4daa7df76b7befaec99e961fc62937fec0ffc5864174ad333e6f1b6c4aaf752958e4b02a58822bd9e5aff7be94e661a5dedcc0426fceebb9
7
+ data.tar.gz: 4125dd4740f496dbea502534b7165e698feb8f4b328e1943382b6021b6324d28a5f7f594221342f58199598f71c2453303abc001e9c97cc794ecc1ef9da6f4a4
@@ -11,6 +11,8 @@ jobs:
11
11
  - 3.0
12
12
  - 3.1
13
13
  - 3.2
14
+ - 3.3
15
+ - 3.4
14
16
  steps:
15
17
  - uses: actions/checkout@v4
16
18
  - uses: ruby/setup-ruby@v1
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ require:
2
2
  - rubocop-rspec
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.5
5
+ TargetRubyVersion: 2.7
6
6
  NewCops: enable
7
7
 
8
8
  # Offense count: 1
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
 
7
7
  gem 'rake', '~> 13.2.1'
8
8
  gem 'rspec', '~> 3.7'
9
- gem 'rubocop-rspec', '~> 2.0'
9
+ gem 'rubocop-rspec', '~> 3.5'
10
10
  gem 'sequel', '~> 5.47'
11
11
  gem 'simplecov', '~> 0.16'
12
12
  gem 'sqlite3', '~> 1.3', '>= 1.3.12'
data/README.md CHANGED
@@ -25,22 +25,25 @@ gem 'rubocop-sequel'
25
25
  Add to your `.rubocop.yml`.
26
26
 
27
27
  ```
28
- require: rubocop-sequel
28
+ plugins: rubocop-sequel
29
29
  ```
30
30
 
31
31
  `rubocop` will now automatically load RuboCop Sequel
32
32
  cops alongside with the standard cops.
33
33
 
34
+ > [!NOTE]
35
+ > The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
36
+
34
37
  ### Command line
35
38
 
36
39
  ```bash
37
- rubocop --require rubocop-sequel
40
+ rubocop --plugin rubocop-sequel
38
41
  ```
39
42
 
40
43
  ### Rake task
41
44
 
42
45
  ```ruby
43
46
  RuboCop::RakeTask.new do |task|
44
- task.requires << 'rubocop-sequel'
47
+ task.plugins << 'rubocop-sequel'
45
48
  end
46
49
  ```
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module Sequel
7
+ # A plugin that integrates rubocop-sequel with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ def about
10
+ LintRoller::About.new(
11
+ name: 'rubocop-sequel',
12
+ version: Version::STRING,
13
+ homepage: 'https://github.com/rubocop/rubocop-sequel',
14
+ description: 'Code style checking for Sequel.'
15
+ )
16
+ end
17
+
18
+ def supported?(context)
19
+ context.engine == :rubocop
20
+ end
21
+
22
+ def rules(_context)
23
+ LintRoller::Rules.new(
24
+ type: :path,
25
+ config_format: :rubocop,
26
+ value: Pathname.new(__dir__).join('../../../config/default.yml')
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,9 +3,7 @@
3
3
  require 'rubocop'
4
4
  require 'rubocop/sequel'
5
5
  require 'rubocop/sequel/version'
6
- require 'rubocop/sequel/inject'
7
-
8
- RuboCop::Sequel::Inject.defaults!
6
+ require 'rubocop/sequel/plugin'
9
7
 
10
8
  require_relative 'rubocop/cop/sequel/helpers/migration'
11
9
 
@@ -12,10 +12,12 @@ Gem::Specification.new do |gem|
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
13
13
  gem.name = 'rubocop-sequel'
14
14
  gem.require_paths = ['lib']
15
- gem.version = '0.3.8'
15
+ gem.version = '0.4.0'
16
16
  gem.metadata['rubygems_mfa_required'] = 'true'
17
+ gem.metadata['default_lint_roller_plugin'] = 'RuboCop::Sequel::Plugin'
17
18
 
18
- gem.required_ruby_version = '>= 2.5'
19
+ gem.required_ruby_version = '>= 2.7'
19
20
 
20
- gem.add_dependency 'rubocop', '~> 1.0'
21
+ gem.add_dependency 'lint_roller', '~> 1.1'
22
+ gem.add_dependency 'rubocop', '>= 1.72.1', '< 1.74.0'
21
23
  end
metadata CHANGED
@@ -1,29 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timothée Peignier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-21 00:00:00.000000000 Z
11
+ date: 2025-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rubocop
14
+ name: lint_roller
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '1.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.72.1
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: 1.74.0
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.72.1
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: 1.74.0
27
47
  description: Code style checking for Sequel
28
48
  email:
29
49
  - timothee.peignier@tryphon.org
@@ -50,7 +70,7 @@ files:
50
70
  - lib/rubocop/cop/sequel/partial_constraint.rb
51
71
  - lib/rubocop/cop/sequel/save_changes.rb
52
72
  - lib/rubocop/sequel.rb
53
- - lib/rubocop/sequel/inject.rb
73
+ - lib/rubocop/sequel/plugin.rb
54
74
  - lib/rubocop/sequel/version.rb
55
75
  - rubocop-sequel.gemspec
56
76
  - spec/project_spec.rb
@@ -67,6 +87,7 @@ licenses:
67
87
  - MIT
68
88
  metadata:
69
89
  rubygems_mfa_required: 'true'
90
+ default_lint_roller_plugin: RuboCop::Sequel::Plugin
70
91
  post_install_message:
71
92
  rdoc_options: []
72
93
  require_paths:
@@ -75,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
96
  requirements:
76
97
  - - ">="
77
98
  - !ruby/object:Gem::Version
78
- version: '2.5'
99
+ version: '2.7'
79
100
  required_rubygems_version: !ruby/object:Gem::Requirement
80
101
  requirements:
81
102
  - - ">="
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Sequel
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
- path = CONFIG_DEFAULT.to_s
10
- hash = ConfigLoader.send(:load_yaml_configuration, path)
11
- config = Config.new(hash, path).tap(&:make_excludes_absolute)
12
- puts "configuration from #{path}" if ConfigLoader.debug?
13
- config = ConfigLoader.merge_with_default(config, path, unset_nil: false)
14
- ConfigLoader.instance_variable_set(:@default_configuration, config)
15
- end
16
- end
17
- end
18
- end