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 +4 -4
- data/README.md +8 -5
- data/config/default.yml +4 -0
- data/lib/rubocop/packaging/plugin.rb +31 -0
- data/lib/rubocop/packaging/version.rb +1 -1
- data/lib/rubocop/packaging.rb +0 -5
- data/lib/rubocop-packaging.rb +1 -4
- metadata +33 -32
- data/lib/rubocop/packaging/inject.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6565506bee250845cebad398a71ebbbaaf098fcfe8e233b9f5ce4a917ea77e90
|
4
|
+
data.tar.gz: da4d689b1d31c3848cdc1fa0215f83ca5d30df069ec2b673b096acc03f1ea40d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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 --
|
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.
|
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
@@ -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
|
data/lib/rubocop/packaging.rb
CHANGED
@@ -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
|
data/lib/rubocop-packaging.rb
CHANGED
@@ -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/
|
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.
|
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:
|
11
|
+
date: 2025-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: lint_roller
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
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:
|
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:
|
48
|
+
name: bump
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
30
50
|
requirements:
|
31
51
|
- - "~>"
|
32
52
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
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.
|
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.
|
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.
|
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
|