rubocop-packaging 0.5.2 → 0.6.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: 45a3b0981916c4440d8092538357892c433f57955f845b45ab3890086e0e0bd2
4
- data.tar.gz: b7caa60273e00c8d3468e5f7d7235a1c5a99088d935fc0a2803d8611c4df1f87
3
+ metadata.gz: 6565506bee250845cebad398a71ebbbaaf098fcfe8e233b9f5ce4a917ea77e90
4
+ data.tar.gz: da4d689b1d31c3848cdc1fa0215f83ca5d30df069ec2b673b096acc03f1ea40d
5
5
  SHA512:
6
- metadata.gz: 676a58d6efb8be59c432cb299dc229b497753b4630802e4f0b274f0359d3e2349b08311519f7e252965d877f3046cb7d30ee1bfba6f6a19d546d38b411bae349
7
- data.tar.gz: 3fd0d9db07d161dbf6740d8e3947909f2fe486235b933ae5af06befce00c461ca7c61149a65559d7568ed1a1cfb674f0d1c45b01d8a7e8644daadbd8d5a5d5c5
6
+ metadata.gz: e7b32669885afb6c10df34e5b0dfac80475fa577997d89b8552889b85b797d3b1b8d254761d8c04d69efbbd32de54d34d1ed52da3b8a07eacfc5dffa152233b2
7
+ data.tar.gz: e259c5354b6ef3ae14b8f7f3f17c24973d793b31a9b0c325b3ddddeaa31697f11c903d39287b0c85d6ecf4fa7e6dcffc47b8e0b8d21a6266d1d70b27a57e68a6
data/README.md CHANGED
@@ -48,14 +48,14 @@ ways to do this:
48
48
  Put this into your `.rubocop.yml` file:
49
49
 
50
50
  ```yaml
51
- require: rubocop-packaging
51
+ plugins: rubocop-packaging
52
52
  ```
53
53
 
54
54
  Alternatively, use the following array notation when specifying multiple
55
55
  extensions:
56
56
 
57
57
  ```yaml
58
- require:
58
+ plugins:
59
59
  - rubocop-other-extension
60
60
  - rubocop-packaging
61
61
  ```
@@ -63,17 +63,20 @@ require:
63
63
  Now you can run `rubocop` and it will automatically load the RuboCop Packaging
64
64
  cops together with the standard cops.
65
65
 
66
+ > [!NOTE]
67
+ > The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
68
+
66
69
  ### Command line
67
70
 
68
71
  ```bash
69
- rubocop --require rubocop-packaging
72
+ rubocop --plugin rubocop-packaging
70
73
  ```
71
74
 
72
75
  ### Rake task
73
76
 
74
77
  ```ruby
75
78
  RuboCop::RakeTask.new do |task|
76
- task.requires << 'rubocop-packaging'
79
+ task.plugins << 'rubocop-packaging'
77
80
  end
78
81
  ```
79
82
 
@@ -87,7 +90,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
87
90
 
88
91
  ## Contributing
89
92
 
90
- As always, bug reports and pull requests are heartily welcomed! 💖
93
+ As always, bug reports and pull requests are heartily welcomed! 💖
91
94
  This project is intended to be a safe and welcoming space for collaboration.
92
95
 
93
96
  ## License
data/config/default.yml CHANGED
@@ -1,5 +1,9 @@
1
1
  # This is the default configuration file.
2
2
 
3
+ Packaging:
4
+ Enabled: true
5
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop-packaging
6
+
3
7
  Packaging/BundlerSetupInTests:
4
8
  Description: >-
5
9
  Using `bundler/setup` in tests is redundant. Consider
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lint_roller"
4
+
5
+ module RuboCop
6
+ module Packaging
7
+ # A plugin that integrates RuboCop Packaging with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ def about
10
+ LintRoller::About.new(
11
+ name: "rubocop-packaging",
12
+ version: VERSION,
13
+ homepage: "https://github.com/utkarsh2102/rubocop-packaging",
14
+ description: "A collection of RuboCop cops to check for downstream compatibility issues in the Ruby code."
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Packaging
5
- VERSION = "0.5.2"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
@@ -5,10 +5,5 @@ require "rubocop/packaging/version"
5
5
  module RuboCop
6
6
  # RuboCop Packaging project namespace
7
7
  module Packaging
8
- PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
9
- CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
10
- CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
11
-
12
- private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
13
8
  end
14
9
  end
@@ -4,8 +4,5 @@ require "rubocop"
4
4
 
5
5
  require_relative "rubocop/packaging"
6
6
  require_relative "rubocop/packaging/version"
7
- require_relative "rubocop/packaging/inject"
8
-
9
- RuboCop::Packaging::Inject.defaults!
10
-
7
+ require_relative "rubocop/packaging/plugin"
11
8
  require_relative "rubocop/cop/packaging_cops"
metadata CHANGED
@@ -1,43 +1,63 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Utkarsh Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2025-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bump
14
+ name: lint_roller
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
20
- type: :development
19
+ version: 1.1.0
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: '0.8'
26
+ version: 1.1.0
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: '2.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: '2.0'
27
47
  - !ruby/object:Gem::Dependency
28
- name: pry
48
+ name: bump
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: '0.13'
53
+ version: '0.8'
34
54
  type: :development
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
37
57
  requirements:
38
58
  - - "~>"
39
59
  - !ruby/object:Gem::Version
40
- version: '0.13'
60
+ version: '0.8'
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: rake
43
63
  requirement: !ruby/object:Gem::Requirement
@@ -80,26 +100,6 @@ dependencies:
80
100
  - - "~>"
81
101
  - !ruby/object:Gem::Version
82
102
  version: '0.9'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '1.33'
90
- - - "<"
91
- - !ruby/object:Gem::Version
92
- version: '2.0'
93
- type: :runtime
94
- prerelease: false
95
- version_requirements: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- version: '1.33'
100
- - - "<"
101
- - !ruby/object:Gem::Version
102
- version: '2.0'
103
103
  description: |
104
104
  A collection of RuboCop cops to check for downstream compatibility issues in the
105
105
  Ruby code.
@@ -119,8 +119,8 @@ files:
119
119
  - lib/rubocop/cop/packaging/require_relative_hardcoding_lib.rb
120
120
  - lib/rubocop/cop/packaging_cops.rb
121
121
  - lib/rubocop/packaging.rb
122
- - lib/rubocop/packaging/inject.rb
123
122
  - lib/rubocop/packaging/lib_helper_module.rb
123
+ - lib/rubocop/packaging/plugin.rb
124
124
  - lib/rubocop/packaging/version.rb
125
125
  homepage: https://github.com/utkarsh2102/rubocop-packaging
126
126
  licenses:
@@ -129,6 +129,7 @@ metadata:
129
129
  homepage_uri: https://github.com/utkarsh2102/rubocop-packaging
130
130
  source_code_uri: https://github.com/utkarsh2102/rubocop-packaging
131
131
  rubygems_mfa_required: 'true'
132
+ default_lint_roller_plugin: RuboCop::Packaging::Plugin
132
133
  post_install_message:
133
134
  rdoc_options: []
134
135
  require_paths:
@@ -137,14 +138,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
138
  requirements:
138
139
  - - ">="
139
140
  - !ruby/object:Gem::Version
140
- version: 2.6.0
141
+ version: 2.7.0
141
142
  required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  requirements:
143
144
  - - ">="
144
145
  - !ruby/object:Gem::Version
145
146
  version: '0'
146
147
  requirements: []
147
- rubygems_version: 3.3.5
148
+ rubygems_version: 3.3.3
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: Automatic downstream compatibility checking tool for Ruby code
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Packaging
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)
14
- ConfigLoader.instance_variable_set(:@default_configuration, config)
15
- end
16
- end
17
- end
18
- end