standard 1.28.1 → 1.28.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8c0920e71bbf9f203f59f683dfaec09f0b5828546a4b47d9d72079aa2a8fda9
4
- data.tar.gz: 53cce6a924e050971619a48ae411dba9e002f0c3cdd48588c3f7a2ee68e20c9f
3
+ metadata.gz: 30b728f2836aad5e7fddd215df4ff85951020b33cac13b33ab1961c5ed24ee89
4
+ data.tar.gz: 80ed236d661fd860ef7dc08d4b65d6c10b4495135527083c301b6a345853d182
5
5
  SHA512:
6
- metadata.gz: f8d4318e2527b6f2d20308caa846ba861a1432a9b1930ebfd2003475eed86dc0b095191cc64f1415a8d6f6130e82923e792cbadfc686eb60401a18026ea8b0df
7
- data.tar.gz: e1fa000dc59e5c530a369238ddc1beb75470d10deb191709bc9d84546b39a327bb4bd80ee80202ec81fc788fee8cd8af588ccab75a4f111457336a16af3a9e52
6
+ metadata.gz: 67c06d4ad34dc5036054a9c08961344fb3f41fbe81738e46dcb3dcbfb926d2291fd3e864c0694f73d4659d3f71ee904d2676bdc87e82b9e06def612c89d9cd24
7
+ data.tar.gz: ae8bb8be8db855f1815265db396020269ee4f79703fd181b5a84c460a932e204140848e4be81522e10866afca018e73b58a5712b181bee5506e7ee1c9c1abbd5
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  matrix:
18
18
  os: [ubuntu-latest]
19
- ruby-version: [2.6, 2.7, '3.0', 3.1, 3.2]
19
+ ruby-version: [2.6, 2.7, '3.0', 3.1, 3.2, head]
20
20
 
21
21
  runs-on: ${{ matrix.os }}
22
22
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.28.3
4
+
5
+ * Older ruby support fixes from [@pboling](https://github.com/pboling):
6
+ - [#559](https://github.com/standardrb/standard/issues/559)
7
+ - [#561](https://github.com/standardrb/standard/issues/560)
8
+ - [#561](https://github.com/standardrb/standard/issues/561)
9
+
10
+ ## 1.28.2
11
+
12
+ * Attempts to fix the not-actually fixed plugin behavior in 1.28.1
13
+
3
14
  ## 1.28.1
4
15
 
5
16
  * Fixes plugin behavior caused by setting `DisabledByDefault: true` in `AllCops`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (1.28.1)
4
+ standard (1.28.3)
5
5
  language_server-protocol (~> 3.17.0.2)
6
6
  lint_roller (~> 1.0)
7
7
  rubocop (~> 1.50.2)
@@ -39,7 +39,7 @@ GEM
39
39
  rubocop-ast (>= 1.28.0, < 2.0)
40
40
  ruby-progressbar (~> 1.7)
41
41
  unicode-display_width (>= 2.4.0, < 3.0)
42
- rubocop-ast (1.28.0)
42
+ rubocop-ast (1.28.1)
43
43
  parser (>= 3.2.1.0)
44
44
  rubocop-performance (1.16.0)
45
45
  rubocop (>= 1.7.0, < 2.0)
data/README.md CHANGED
@@ -432,6 +432,11 @@ extend_config:
432
432
 
433
433
  ### Running Standard's rules via RuboCop
434
434
 
435
+ **Please note that the following usage is not supported and may break at any
436
+ time. Use at your own risk and please refrain from opening GitHub issues with
437
+ respect to loading Standard or its plugins' YAML configurations for use by
438
+ the `rubocop` CLI.**
439
+
435
440
  If you find that neither plugins or configuration extensions meet your needs or
436
441
  if you have some other reason to run Standard's rules with RuboCop's CLI (e.g.,
437
442
  to continue using your favorite IDE/tooling/workflow with RuboCop support) Evil
@@ -466,6 +471,7 @@ Here are a few examples of Ruby Standard-compliant teams & projects:
466
471
  * [Brave Software](https://github.com/brave-intl/publishers)
467
472
  * [Collective Idea](https://collectiveidea.com/)
468
473
  * [Culture Foundry](https://www.culturefoundry.com/)
474
+ * [Donut](https://www.donut.com/)
469
475
  * [Elevate Labs](https://elevatelabs.com)
470
476
  * [Envoy](https://www.envoy.com)
471
477
  * [Evil Martians](https://evilmartians.com)
data/config/ruby-1.8.yml CHANGED
@@ -11,3 +11,6 @@ Style/FileWrite:
11
11
 
12
12
  Style/FileRead:
13
13
  Enabled: false
14
+
15
+ Layout/DotPosition:
16
+ Enabled: false
data/config/ruby-3.1.yml CHANGED
@@ -1,4 +1,4 @@
1
- inherit_from: ./base.yml
1
+ inherit_from: ./ruby-3.2.yml
2
2
 
3
3
  AllCops:
4
4
  TargetRubyVersion: 3.1
@@ -0,0 +1,4 @@
1
+ inherit_from: ./base.yml
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 3.2
@@ -55,6 +55,8 @@ module Standard::Base
55
55
  "ruby-3.0.yml"
56
56
  elsif desired_version < Gem::Version.new("3.2")
57
57
  "ruby-3.1.yml"
58
+ elsif desired_version < Gem::Version.new("3.3")
59
+ "ruby-3.2.yml"
58
60
  else
59
61
  default
60
62
  end
@@ -27,17 +27,16 @@ module Standard
27
27
 
28
28
  def call(options_config, standard_config, plugins, permit_merging:)
29
29
  runner_context = @creates_runner_context.call(standard_config)
30
- plugin_config = combine_rubocop_configs(options_config, runner_context, plugins).to_h
30
+ plugin_config = combine_rubocop_configs(options_config, runner_context, plugins, permit_merging: permit_merging).to_h
31
31
  merge_config_into_all_cops!(options_config, plugin_config)
32
32
  merge_config_into_standard!(options_config, plugin_config, permit_merging: permit_merging)
33
33
  end
34
34
 
35
35
  private
36
36
 
37
- def combine_rubocop_configs(options_config, runner_context, plugins)
37
+ def combine_rubocop_configs(options_config, runner_context, plugins, permit_merging:)
38
+ all_cop_keys_configured_by_plugins = all_cop_keys_previously_configured_by_plugins(options_config, permit_merging: permit_merging)
38
39
  fake_out_rubocop_default_configuration(options_config) do |fake_config|
39
- all_cop_keys_configured_by_plugins = []
40
-
41
40
  plugins.reduce(fake_config) do |combined_config, plugin|
42
41
  RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, combined_config)
43
42
  next_config, path = config_for_plugin(plugin, runner_context)
@@ -49,7 +48,7 @@ module Standard
49
48
  )
50
49
  delete_already_configured_keys!(combined_config.keys, next_config, dont_delete_keys: ["AllCops"])
51
50
 
52
- RuboCop::ConfigLoader.merge_with_default(next_config, path)
51
+ RuboCop::ConfigLoader.merge_with_default(next_config, path, unset_nil: false)
53
52
  end
54
53
  end
55
54
  end
@@ -61,7 +60,7 @@ module Standard
61
60
  [RuboCop::ConfigLoader.load_file(rules.value), rules.value]
62
61
  elsif rules.type == :object
63
62
  path = plugin.method(:rules).source_location[0]
64
- [RuboCop::Config.create(rules.value, path), path]
63
+ [RuboCop::Config.create(rules.value, path, check: true), path]
65
64
  elsif rules.type == :error
66
65
  raise "Plugin `#{plugin.about&.name || plugin.inspect}' failed to load with error: #{rules.value.respond_to?(:message) ? rules.value.message : rules.value}"
67
66
  end
@@ -124,8 +123,16 @@ module Standard
124
123
  end
125
124
  end
126
125
 
126
+ def all_cop_keys_previously_configured_by_plugins(options_config, permit_merging:)
127
+ if permit_merging
128
+ []
129
+ else
130
+ Array(options_config["AllCops"]&.keys) - RuboCop::ConfigLoader.default_configuration["AllCops"].keys
131
+ end
132
+ end
133
+
127
134
  def fake_out_rubocop_default_configuration(options_config)
128
- og_default_config = RuboCop::ConfigLoader.instance_variable_get(:@default_configuration)
135
+ og_default_config = RuboCop::ConfigLoader.default_configuration
129
136
  set_target_rails_version_on_all_cops_because_its_technically_not_allowed!(options_config)
130
137
  result = yield blank_rubocop_config(options_config)
131
138
  RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, og_default_config)
@@ -137,9 +144,9 @@ module Standard
137
144
  #
138
145
  # See: https://github.com/rubocop/rubocop/pull/11833
139
146
  def set_target_rails_version_on_all_cops_because_its_technically_not_allowed!(options_config)
140
- return unless options_config.key?("AllCops")
147
+ return if !options_config.key?("AllCops") || options_config["AllCops"].key?("TargetRailsVersion")
141
148
 
142
- options_config["AllCops"]["TargetRailsVersion"] = "~"
149
+ options_config["AllCops"]["TargetRailsVersion"] = nil
143
150
  end
144
151
 
145
152
  def blank_rubocop_config(example_config)
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("1.28.1")
2
+ VERSION = Gem::Version.new("1.28.3")
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.28.1
4
+ version: 1.28.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-01 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -116,6 +116,7 @@ files:
116
116
  - config/ruby-2.7.yml
117
117
  - config/ruby-3.0.yml
118
118
  - config/ruby-3.1.yml
119
+ - config/ruby-3.2.yml
119
120
  - docs/ARCHITECTURE.md
120
121
  - docs/NEW_RUBIES.md
121
122
  - docs/RELEASE.md