standard 1.28.1 → 1.28.3
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/.github/workflows/test.yml +1 -1
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +2 -2
- data/README.md +6 -0
- data/config/ruby-1.8.yml +3 -0
- data/config/ruby-3.1.yml +1 -1
- data/config/ruby-3.2.yml +4 -0
- data/lib/standard/base/plugin.rb +2 -0
- data/lib/standard/plugin/merges_plugins_into_rubocop_config.rb +16 -9
- data/lib/standard/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30b728f2836aad5e7fddd215df4ff85951020b33cac13b33ab1961c5ed24ee89
|
4
|
+
data.tar.gz: 80ed236d661fd860ef7dc08d4b65d6c10b4495135527083c301b6a345853d182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67c06d4ad34dc5036054a9c08961344fb3f41fbe81738e46dcb3dcbfb926d2291fd3e864c0694f73d4659d3f71ee904d2676bdc87e82b9e06def612c89d9cd24
|
7
|
+
data.tar.gz: ae8bb8be8db855f1815265db396020269ee4f79703fd181b5a84c460a932e204140848e4be81522e10866afca018e73b58a5712b181bee5506e7ee1c9c1abbd5
|
data/.github/workflows/test.yml
CHANGED
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.
|
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.
|
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
data/config/ruby-3.1.yml
CHANGED
data/config/ruby-3.2.yml
ADDED
data/lib/standard/base/plugin.rb
CHANGED
@@ -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.
|
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
|
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)
|
data/lib/standard/version.rb
CHANGED
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.
|
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-
|
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
|