standard-performance 1.1.0 → 1.1.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: 1bae992bcc9fe9ebfe27b0fa39731373d07c9fa4eb60ca6d5114c3a2d20bb152
4
- data.tar.gz: bdc0203b28a41368821a1dcab79bb6da9dbf4e1885f9f37536158082117ed223
3
+ metadata.gz: d3313cb1b98296491d99d1c41ba34d8fb1d23554a3db84466c38a74bba905762
4
+ data.tar.gz: 0fde13d39f95f79376ae9c848a180661f708168033395cb0d66bb3a04ef57aba
5
5
  SHA512:
6
- metadata.gz: d1bd85a254885e8850d2b22fdde747c47ec8e31685d9325e0e030cd41b4e2e69389ce684bc667e30b3f96c26598fdbaad4642b0a0b333fd49b668dfc4ec5a738
7
- data.tar.gz: e3187abc3f81b1e20d7a2c6c2e0e312400946dbedc2424e5a98c579d12a79cad6acd77acf1b69a0f69c277c603de900bf4e15b0564f7cb6d6d80ea8f3f3c6474
6
+ metadata.gz: 6c0e97d9db245d0a97e1a4cb35cd2835de358b98d973056a8c6e2f0f4353e6fbf7d935f8c7da9d8d6667d7f7a4e0e4bafffc17f49e627b41ffb9051c4fc1b567
7
+ data.tar.gz: bdf5658c49bfb5e21c58c22dc00db7e335217eab5c8cbd0afbf4779aab2421b2e8acba81ef7ed316b1160b9b4cb03b613f8988b89923d80b8df745fb31e8a240
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.1.1]
2
+
3
+ - Preserve metadata from rubocop-performance by merging it
4
+
1
5
  ## [1.1.0]
2
6
 
3
7
  - Updates rubocop-performance from 1.16.0 to 1.18.0
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard-performance (1.1.0)
5
- lint_roller (~> 1.0)
4
+ standard-performance (1.1.1)
5
+ lint_roller (~> 1.1)
6
6
  rubocop-performance (~> 1.18.0)
7
7
 
8
8
  GEM
@@ -11,23 +11,25 @@ GEM
11
11
  ast (2.4.2)
12
12
  json (2.6.3)
13
13
  language_server-protocol (3.17.0.3)
14
- lint_roller (1.0.0)
14
+ lint_roller (1.1.0)
15
15
  m (1.6.1)
16
16
  method_source (>= 0.6.7)
17
17
  rake (>= 0.9.2.2)
18
18
  method_source (1.0.0)
19
- minitest (5.18.0)
19
+ minitest (5.18.1)
20
20
  parallel (1.23.0)
21
- parser (3.2.2.1)
21
+ parser (3.2.2.3)
22
22
  ast (~> 2.4.1)
23
+ racc
24
+ racc (1.7.1)
23
25
  rainbow (3.1.1)
24
26
  rake (13.0.6)
25
- regexp_parser (2.8.0)
27
+ regexp_parser (2.8.1)
26
28
  rexml (3.2.5)
27
- rubocop (1.50.2)
29
+ rubocop (1.52.1)
28
30
  json (~> 2.3)
29
31
  parallel (~> 1.10)
30
- parser (>= 3.2.0.0)
32
+ parser (>= 3.2.2.3)
31
33
  rainbow (>= 2.2.2, < 4.0)
32
34
  regexp_parser (>= 1.8, < 3.0)
33
35
  rexml (>= 3.2.5, < 4.0)
@@ -40,13 +42,13 @@ GEM
40
42
  rubocop (>= 1.7.0, < 2.0)
41
43
  rubocop-ast (>= 0.4.0)
42
44
  ruby-progressbar (1.13.0)
43
- standard (1.28.5)
45
+ standard (1.30.0)
44
46
  language_server-protocol (~> 3.17.0.2)
45
47
  lint_roller (~> 1.0)
46
- rubocop (~> 1.50.2)
48
+ rubocop (~> 1.52.0)
47
49
  standard-custom (~> 1.0.0)
48
- standard-performance (~> 1.0.1)
49
- standard-custom (1.0.0)
50
+ standard-performance (~> 1.1.0)
51
+ standard-custom (1.0.1)
50
52
  lint_roller (~> 1.0)
51
53
  unicode-display_width (2.4.2)
52
54
 
@@ -0,0 +1,28 @@
1
+ module Standard
2
+ module Performance
3
+ class DeterminesYamlPath
4
+ def determine(desired_version)
5
+ desired_version = Gem::Version.new(desired_version) unless desired_version.is_a?(Gem::Version)
6
+ default = "base.yml"
7
+
8
+ file_name = if !Gem::Version.correct?(desired_version)
9
+ default
10
+ elsif desired_version < Gem::Version.new("1.9")
11
+ "ruby-1.8.yml"
12
+ elsif desired_version < Gem::Version.new("2.0")
13
+ "ruby-1.9.yml"
14
+ elsif desired_version < Gem::Version.new("2.1")
15
+ "ruby-2.0.yml"
16
+ elsif desired_version < Gem::Version.new("2.2")
17
+ "ruby-2.1.yml"
18
+ elsif desired_version < Gem::Version.new("2.3")
19
+ "ruby-2.2.yml"
20
+ else
21
+ default
22
+ end
23
+
24
+ Pathname.new(__dir__).join("../../../config/#{file_name}")
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,7 +1,11 @@
1
+ require_relative "determines_yaml_path"
2
+
1
3
  module Standard::Performance
2
4
  class Plugin < LintRoller::Plugin
3
5
  def initialize(config)
4
6
  @config = config
7
+ @merges_upstream_metadata = LintRoller::Support::MergesUpstreamMetadata.new
8
+ @determines_yaml_path = DeterminesYamlPath.new
5
9
  end
6
10
 
7
11
  def about
@@ -20,10 +24,15 @@ module Standard::Performance
20
24
  def rules(context)
21
25
  trick_rubocop_into_thinking_we_required_rubocop_performance!
22
26
 
27
+ rules = @merges_upstream_metadata.merge(
28
+ YAML.load_file(@determines_yaml_path.determine(context.target_ruby_version)),
29
+ YAML.load_file(Pathname.new(Gem.loaded_specs["rubocop-performance"].full_gem_path).join("config/default.yml"))
30
+ )
31
+
23
32
  LintRoller::Rules.new(
24
- type: :path,
33
+ type: :object,
25
34
  config_format: :rubocop,
26
- value: determine_yaml_path(context.target_ruby_version)
35
+ value: rules
27
36
  )
28
37
  end
29
38
 
@@ -47,28 +56,5 @@ module Standard::Performance
47
56
  require "rubocop/cop/performance_cops"
48
57
  RuboCop::ConfigLoader.default_configuration.loaded_features.add("rubocop-performance")
49
58
  end
50
-
51
- def determine_yaml_path(desired_version)
52
- desired_version = Gem::Version.new(desired_version) unless desired_version.is_a?(Gem::Version)
53
- default = "base.yml"
54
-
55
- file_name = if !Gem::Version.correct?(desired_version)
56
- default
57
- elsif desired_version < Gem::Version.new("1.9")
58
- "ruby-1.8.yml"
59
- elsif desired_version < Gem::Version.new("2.0")
60
- "ruby-1.9.yml"
61
- elsif desired_version < Gem::Version.new("2.1")
62
- "ruby-2.0.yml"
63
- elsif desired_version < Gem::Version.new("2.2")
64
- "ruby-2.1.yml"
65
- elsif desired_version < Gem::Version.new("2.3")
66
- "ruby-2.2.yml"
67
- else
68
- default
69
- end
70
-
71
- Pathname.new(__dir__).join("../../../config/#{file_name}")
72
- end
73
59
  end
74
60
  end
@@ -1,5 +1,5 @@
1
1
  module Standard
2
2
  module Performance
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard-performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-02 00:00:00.000000000 Z
11
+ date: 2023-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lint_roller
@@ -16,14 +16,14 @@ dependencies:
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
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-performance
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.18.0
41
- description:
41
+ description:
42
42
  email:
43
43
  - searls@gmail.com
44
44
  executables: []
@@ -61,6 +61,7 @@ files:
61
61
  - docs/RELEASE.md
62
62
  - lib/standard-performance.rb
63
63
  - lib/standard/performance.rb
64
+ - lib/standard/performance/determines_yaml_path.rb
64
65
  - lib/standard/performance/plugin.rb
65
66
  - lib/standard/performance/version.rb
66
67
  homepage: https://github.com/standardrb/standard-performance
@@ -71,7 +72,7 @@ metadata:
71
72
  source_code_uri: https://github.com/standardrb/standard-performance
72
73
  changelog_uri: https://github.com/standardrb/standard-performance/blob/main/CHANGELOG.md
73
74
  default_lint_roller_plugin: Standard::Performance::Plugin
74
- post_install_message:
75
+ post_install_message:
75
76
  rdoc_options: []
76
77
  require_paths:
77
78
  - lib
@@ -86,8 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  - !ruby/object:Gem::Version
87
88
  version: '0'
88
89
  requirements: []
89
- rubygems_version: 3.1.6
90
- signing_key:
90
+ rubygems_version: 3.4.14
91
+ signing_key:
91
92
  specification_version: 4
92
93
  summary: Standard Ruby Plugin providing configuration for rubocop-performance
93
94
  test_files: []