rubocop-migration 0.6.0 → 0.7.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: 6111e3315299e3a1c4253b7d510ad1f6a55d47b02972e0e375c28afba5e7c843
4
- data.tar.gz: efda513621a03f5ead2875ef266f53db6359560d28fc31431e81ec1e3c63397c
3
+ metadata.gz: '0022087bc8e99cf2bc4e2f3baedb7b2b0ad587ff426f9bcd340646553662c866'
4
+ data.tar.gz: ce12e03910ea987ce6a38b809e30e62a37ce22faf0d9ab6c48c0fb4d3b482e5c
5
5
  SHA512:
6
- metadata.gz: 493f7789e8f84e6175892ec5155d34a5ac5b48b961b82244f0d079401d999a3ddd96b316c5d61ffa48087377b6647318806254420461308db66b5f3e3bc9d175
7
- data.tar.gz: bd1382048435dd5e43b049a9572732ba801cd7fe4617a05e3a0097afd75f8c5b4237b15caade091b279338f907d2327cc9495e922a55e9660d1ff56b406188a9
6
+ metadata.gz: 536056846d52490c2fdebbedafb3e4db06704a3f18bb6c1bcf7fbcb9f85e19bc3385f0911fb9358a26bbf4e2c0d56338fd5790821b7881297c51dd73fb9c3356
7
+ data.tar.gz: 6c4b6f308b59b2cfcf50cde30072d848f5c5656cba79f0b2248b02a5ef2daf169d9f76d92090ac6e18284f4803a20bd38c80258fc3693254e0a1c9051fbf8114
data/.rubocop.yml CHANGED
@@ -1,9 +1,11 @@
1
- require:
2
- - rubocop/cop/internal_affairs
1
+ plugins:
2
+ - rubocop-internal_affairs
3
3
  - rubocop-migration
4
+ - rubocop-rspec
4
5
  - rubocop-performance
5
6
  - rubocop-rake
6
- - rubocop-rspec
7
+
8
+ require:
7
9
  - sevencop
8
10
 
9
11
  AllCops:
data/Gemfile.lock CHANGED
@@ -1,103 +1,107 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-migration (0.6.0)
4
+ rubocop-migration (0.7.0)
5
5
  activesupport
6
- rubocop (>= 1.34)
6
+ lint_roller (>= 1.1)
7
+ rubocop (>= 1.72.1)
7
8
  rubocop-rails (>= 2.24)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
- activesupport (7.1.3)
13
+ activesupport (7.1.5.1)
13
14
  base64
15
+ benchmark (>= 0.3)
14
16
  bigdecimal
15
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
18
  connection_pool (>= 2.2.5)
17
19
  drb
18
20
  i18n (>= 1.6, < 2)
21
+ logger (>= 1.4.2)
19
22
  minitest (>= 5.1)
20
23
  mutex_m
24
+ securerandom (>= 0.3)
21
25
  tzinfo (~> 2.0)
22
- ast (2.4.2)
26
+ ast (2.4.3)
23
27
  base64 (0.2.0)
24
- bigdecimal (3.1.6)
25
- concurrent-ruby (1.2.3)
26
- connection_pool (2.4.1)
27
- diff-lcs (1.5.0)
28
- drb (2.2.0)
29
- ruby2_keywords
30
- i18n (1.14.1)
28
+ benchmark (0.4.0)
29
+ bigdecimal (3.1.9)
30
+ concurrent-ruby (1.3.5)
31
+ connection_pool (2.5.0)
32
+ diff-lcs (1.6.1)
33
+ drb (2.2.1)
34
+ i18n (1.14.7)
31
35
  concurrent-ruby (~> 1.0)
32
- json (2.7.1)
33
- language_server-protocol (3.17.0.3)
34
- minitest (5.21.2)
35
- mutex_m (0.2.0)
36
- parallel (1.24.0)
37
- parser (3.3.0.5)
36
+ json (2.10.2)
37
+ language_server-protocol (3.17.0.4)
38
+ lint_roller (1.1.0)
39
+ logger (1.7.0)
40
+ minitest (5.25.5)
41
+ mutex_m (0.3.0)
42
+ parallel (1.26.3)
43
+ parser (3.3.7.4)
38
44
  ast (~> 2.4.1)
39
45
  racc
40
- racc (1.7.3)
41
- rack (3.1.9)
46
+ prism (1.4.0)
47
+ racc (1.8.1)
48
+ rack (3.1.12)
42
49
  rainbow (3.1.1)
43
- rake (13.1.0)
44
- regexp_parser (2.9.0)
45
- rexml (3.2.6)
46
- rspec (3.12.0)
47
- rspec-core (~> 3.12.0)
48
- rspec-expectations (~> 3.12.0)
49
- rspec-mocks (~> 3.12.0)
50
- rspec-core (3.12.2)
51
- rspec-support (~> 3.12.0)
52
- rspec-expectations (3.12.3)
50
+ rake (13.2.1)
51
+ regexp_parser (2.10.0)
52
+ rspec (3.13.0)
53
+ rspec-core (~> 3.13.0)
54
+ rspec-expectations (~> 3.13.0)
55
+ rspec-mocks (~> 3.13.0)
56
+ rspec-core (3.13.3)
57
+ rspec-support (~> 3.13.0)
58
+ rspec-expectations (3.13.3)
53
59
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.12.0)
55
- rspec-mocks (3.12.6)
60
+ rspec-support (~> 3.13.0)
61
+ rspec-mocks (3.13.2)
56
62
  diff-lcs (>= 1.2.0, < 2.0)
57
- rspec-support (~> 3.12.0)
58
- rspec-support (3.12.1)
59
- rubocop (1.63.4)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-support (3.13.2)
65
+ rubocop (1.75.2)
60
66
  json (~> 2.3)
61
- language_server-protocol (>= 3.17.0)
67
+ language_server-protocol (~> 3.17.0.2)
68
+ lint_roller (~> 1.1.0)
62
69
  parallel (~> 1.10)
63
70
  parser (>= 3.3.0.2)
64
71
  rainbow (>= 2.2.2, < 4.0)
65
- regexp_parser (>= 1.8, < 3.0)
66
- rexml (>= 3.2.5, < 4.0)
67
- rubocop-ast (>= 1.31.1, < 2.0)
72
+ regexp_parser (>= 2.9.3, < 3.0)
73
+ rubocop-ast (>= 1.44.0, < 2.0)
68
74
  ruby-progressbar (~> 1.7)
69
- unicode-display_width (>= 2.4.0, < 3.0)
70
- rubocop-ast (1.31.2)
71
- parser (>= 3.3.0.4)
72
- rubocop-capybara (2.20.0)
73
- rubocop (~> 1.41)
74
- rubocop-factory_bot (2.25.1)
75
- rubocop (~> 1.41)
76
- rubocop-performance (1.20.2)
77
- rubocop (>= 1.48.1, < 2.0)
78
- rubocop-ast (>= 1.30.0, < 2.0)
79
- rubocop-rails (2.29.1)
75
+ unicode-display_width (>= 2.4.0, < 4.0)
76
+ rubocop-ast (1.44.0)
77
+ parser (>= 3.3.7.2)
78
+ prism (~> 1.4)
79
+ rubocop-performance (1.25.0)
80
+ lint_roller (~> 1.1)
81
+ rubocop (>= 1.75.0, < 2.0)
82
+ rubocop-ast (>= 1.38.0, < 2.0)
83
+ rubocop-rails (2.31.0)
80
84
  activesupport (>= 4.2.0)
85
+ lint_roller (~> 1.1)
81
86
  rack (>= 1.1)
82
- rubocop (>= 1.52.0, < 2.0)
83
- rubocop-ast (>= 1.31.1, < 2.0)
84
- rubocop-rake (0.6.0)
85
- rubocop (~> 1.0)
86
- rubocop-rspec (2.29.2)
87
- rubocop (~> 1.40)
88
- rubocop-capybara (~> 2.17)
89
- rubocop-factory_bot (~> 2.22)
90
- rubocop-rspec_rails (~> 2.28)
91
- rubocop-rspec_rails (2.28.3)
92
- rubocop (~> 1.40)
87
+ rubocop (>= 1.75.0, < 2.0)
88
+ rubocop-ast (>= 1.38.0, < 2.0)
89
+ rubocop-rake (0.7.1)
90
+ lint_roller (~> 1.1)
91
+ rubocop (>= 1.72.1)
92
+ rubocop-rspec (3.5.0)
93
+ lint_roller (~> 1.1)
94
+ rubocop (~> 1.72, >= 1.72.1)
93
95
  ruby-progressbar (1.13.0)
94
- ruby2_keywords (0.0.5)
95
- sevencop (0.35.1)
96
+ securerandom (0.3.2)
97
+ sevencop (0.47.0)
96
98
  activesupport
97
99
  rubocop
98
100
  tzinfo (2.0.6)
99
101
  concurrent-ruby (~> 1.0)
100
- unicode-display_width (2.5.0)
102
+ unicode-display_width (3.1.4)
103
+ unicode-emoji (~> 4.0, >= 4.0.4)
104
+ unicode-emoji (4.0.4)
101
105
 
102
106
  PLATFORMS
103
107
  ruby
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![ci](https://github.com/r7kamura/rubocop-migration/actions/workflows/ci.yml/badge.svg)](https://github.com/r7kamura/rubocop-migration/actions/workflows/ci.yml)
4
4
 
5
- RuboCop extension focused on ActiveRecord migration.
5
+ RuboCop plugin for ActiveRecord migration.
6
6
 
7
7
  ## Usage
8
8
 
@@ -13,11 +13,11 @@ Install `rubocop-migration` gem:
13
13
  gem 'rubocop-migration', require: false
14
14
  ```
15
15
 
16
- then require `rubocop-migration` and enable the cops you want to use in your .rubocop.yml:
16
+ then add `rubocop-migration` to plugins section:
17
17
 
18
18
  ```yaml
19
19
  # .rubocop.yml
20
- require:
20
+ plugins:
21
21
  - rubocop-migration
22
22
 
23
23
  Migration/AddCheckConstraint:
@@ -49,6 +49,7 @@ module RuboCop
49
49
  autocorrect(corrector, node)
50
50
  end
51
51
  end
52
+ alias on_csend on_send
52
53
 
53
54
  private
54
55
 
@@ -56,6 +56,7 @@ module RuboCop
56
56
  )
57
57
  end
58
58
  end
59
+ alias on_csend on_send
59
60
 
60
61
  private
61
62
 
@@ -51,6 +51,7 @@ module RuboCop
51
51
  autocorrect(corrector, node)
52
52
  end
53
53
  end
54
+ alias on_csend on_send
54
55
 
55
56
  private
56
57
 
@@ -36,6 +36,7 @@ module RuboCop
36
36
  message: "Keep unique index columns count less than #{max_columns_count}."
37
37
  )
38
38
  end
39
+ alias on_csend on_send
39
40
 
40
41
  private
41
42
 
@@ -61,6 +61,7 @@ module RuboCop
61
61
  end
62
62
  end
63
63
  end
64
+ alias on_csend on_send
64
65
 
65
66
  private
66
67
 
@@ -9,7 +9,7 @@ module RuboCop
9
9
  # Avoid adding duplicate indexes.
10
10
  #
11
11
  # @safety
12
- # This cop tries to find existing indexes from db/schema.rb, but it cannnot be found.
12
+ # This cop tries to find existing indexes from db/schema.rb, but it cannot be found.
13
13
  #
14
14
  # @example
15
15
  # # bad
@@ -39,6 +39,7 @@ module RuboCop
39
39
 
40
40
  add_offense(node)
41
41
  end
42
+ alias on_csend on_send
42
43
 
43
44
  private
44
45
 
@@ -61,6 +61,7 @@ module RuboCop
61
61
  autocorrect(corrector, node)
62
62
  end
63
63
  end
64
+ alias on_csend on_send
64
65
 
65
66
  private
66
67
 
@@ -58,6 +58,7 @@ module RuboCop
58
58
  autocorrect(corrector, node)
59
59
  end
60
60
  end
61
+ alias on_csend on_send
61
62
 
62
63
  private
63
64
 
@@ -53,6 +53,7 @@ module RuboCop
53
53
  autocorrect(corrector, node)
54
54
  end
55
55
  end
56
+ alias on_csend on_send
56
57
 
57
58
  private
58
59
 
@@ -76,6 +76,7 @@ module RuboCop
76
76
 
77
77
  add_offense(node)
78
78
  end
79
+ alias on_csend on_send
79
80
 
80
81
  private
81
82
 
@@ -52,6 +52,7 @@ module RuboCop
52
52
  autocorrect(corrector, node)
53
53
  end
54
54
  end
55
+ alias on_csend on_send
55
56
 
56
57
  private
57
58
 
@@ -144,7 +145,7 @@ module RuboCop
144
145
  node.first_argument.value.to_s
145
146
  end
146
147
 
147
- # @parm node [RuboCop::AST::SendNode]
148
+ # @param node [RuboCop::AST::SendNode]
148
149
  # @return [String]
149
150
  def find_table_name_from_change_column_null(node)
150
151
  node.first_argument.value.to_s
@@ -43,6 +43,7 @@ module RuboCop
43
43
  autocorrect(corrector, option_node)
44
44
  end
45
45
  end
46
+ alias on_csend on_send
46
47
 
47
48
  private
48
49
 
@@ -39,6 +39,7 @@ module RuboCop
39
39
  corrector.replace(json_range, 'jsonb')
40
40
  end
41
41
  end
42
+ alias on_csend on_send
42
43
 
43
44
  private
44
45
 
@@ -51,6 +51,7 @@ module RuboCop
51
51
 
52
52
  add_offense(node)
53
53
  end
54
+ alias on_csend on_send
54
55
 
55
56
  private
56
57
 
@@ -56,6 +56,7 @@ module RuboCop
56
56
 
57
57
  add_offense(node)
58
58
  end
59
+ alias on_csend on_send
59
60
 
60
61
  private
61
62
 
@@ -54,6 +54,7 @@ module RuboCop
54
54
 
55
55
  add_offense(node)
56
56
  end
57
+ alias on_csend on_send
57
58
 
58
59
  private
59
60
 
@@ -54,6 +54,7 @@ module RuboCop
54
54
  add_offense(identifier_node)
55
55
  end
56
56
  end
57
+ alias on_csend on_send
57
58
 
58
59
  private
59
60
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module Migration
7
+ class Plugin < ::LintRoller::Plugin
8
+ def about
9
+ ::LintRoller::About.new(
10
+ description: 'RuboCop plugin for ActiveRecord migration.',
11
+ homepage: 'https://github.com/r7kamura/rubocop-migration',
12
+ name: 'rubocop-migration',
13
+ version: VERSION
14
+ )
15
+ end
16
+
17
+ def rules(_context)
18
+ ::LintRoller::Rules.new(
19
+ config_format: :rubocop,
20
+ type: :path,
21
+ value: "#{__dir__}/../../../config/default.yml"
22
+ )
23
+ end
24
+
25
+ def supported?(context)
26
+ context.engine == :rubocop
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Rubocop
3
+ module RuboCop
4
4
  module Migration
5
- VERSION = '0.6.0'
5
+ VERSION = '0.7.0'
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'migration/cop_concerns'
4
- require_relative 'migration/rubocop_extension'
4
+ require_relative 'migration/plugin'
5
5
  require_relative 'migration/version'
6
6
 
7
7
  require_relative 'cop/migration/add_check_constraint'
@@ -4,11 +4,11 @@ require_relative 'lib/rubocop/migration/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'rubocop-migration'
7
- spec.version = Rubocop::Migration::VERSION
7
+ spec.version = RuboCop::Migration::VERSION
8
8
  spec.authors = ['Ryo Nakamura']
9
9
  spec.email = ['r7kamura@gmail.com']
10
10
 
11
- spec.summary = 'RuboCop extension focused on ActiveRecord migration.'
11
+ spec.summary = 'RuboCop plugin for ActiveRecord migration.'
12
12
  spec.homepage = 'https://github.com/r7kamura/rubocop-migration'
13
13
  spec.license = 'MIT'
14
14
  spec.required_ruby_version = '>= 2.7'
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
18
18
  spec.metadata['changelog_uri'] = "#{spec.homepage}/releases"
19
+ spec.metadata['default_lint_roller_plugin'] = 'RuboCop::Migration::Plugin'
19
20
 
20
21
  spec.files = Dir.chdir(__dir__) do
21
22
  `git ls-files -z`.split("\x0").reject do |f|
@@ -27,6 +28,7 @@ Gem::Specification.new do |spec|
27
28
  spec.require_paths = ['lib']
28
29
 
29
30
  spec.add_dependency 'activesupport'
30
- spec.add_dependency 'rubocop', '>= 1.34'
31
+ spec.add_dependency 'lint_roller', '>= 1.1'
32
+ spec.add_dependency 'rubocop', '>= 1.72.1'
31
33
  spec.add_dependency 'rubocop-rails', '>= 2.24'
32
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-06 00:00:00.000000000 Z
11
+ date: 2025-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,20 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: lint_roller
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubocop
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '1.34'
47
+ version: 1.72.1
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '1.34'
54
+ version: 1.72.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rubocop-rails
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -92,7 +106,7 @@ files:
92
106
  - lib/rubocop/migration/cop_concerns/batch_processing.rb
93
107
  - lib/rubocop/migration/cop_concerns/column_type_method.rb
94
108
  - lib/rubocop/migration/cop_concerns/disable_ddl_transaction.rb
95
- - lib/rubocop/migration/rubocop_extension.rb
109
+ - lib/rubocop/migration/plugin.rb
96
110
  - lib/rubocop/migration/version.rb
97
111
  - rubocop-migration.gemspec
98
112
  homepage: https://github.com/r7kamura/rubocop-migration
@@ -102,6 +116,7 @@ metadata:
102
116
  homepage_uri: https://github.com/r7kamura/rubocop-migration
103
117
  source_code_uri: https://github.com/r7kamura/rubocop-migration
104
118
  changelog_uri: https://github.com/r7kamura/rubocop-migration/releases
119
+ default_lint_roller_plugin: RuboCop::Migration::Plugin
105
120
  post_install_message:
106
121
  rdoc_options: []
107
122
  require_paths:
@@ -117,8 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
132
  - !ruby/object:Gem::Version
118
133
  version: '0'
119
134
  requirements: []
120
- rubygems_version: 3.5.11
135
+ rubygems_version: 3.3.27
121
136
  signing_key:
122
137
  specification_version: 4
123
- summary: RuboCop extension focused on ActiveRecord migration.
138
+ summary: RuboCop plugin for ActiveRecord migration.
124
139
  test_files: []
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubocop'
4
-
5
- require_relative 'config_loader'
6
-
7
- RuboCop::ConfigLoader.instance_variable_set(
8
- :@default_configuration,
9
- RuboCop::Migration::ConfigLoader.call(
10
- path: File.expand_path(
11
- '../../../config/default.yml',
12
- __dir__
13
- )
14
- )
15
- )