standard 1.28.0 → 1.29.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: f90048ed9d5a6f7fb709f72f0ce48e3afca1207f4b75ec7673baaa77b7a15ed8
4
- data.tar.gz: e29c6e2e9c919611bfaf1ec1fb2907c0bb2552eb06a7a4340e45140ec0c0a2ad
3
+ metadata.gz: d0beb51ce9976fc9de3f3daad988e62190aaf87c9641850bcd6f0b0e2503745b
4
+ data.tar.gz: 94cffff45294c2b64124c0b655fbe448d314e5bd1aa7d30dbde08f75326ff413
5
5
  SHA512:
6
- metadata.gz: 53482d43182ade55a2828dd8fbd877c54dfc88cddf7dfdc842fb6a2ade273930fd43422dac37687f42617bfc35d2c65ac2b11211abad4e4d7f1a5409b5fa6cf3
7
- data.tar.gz: 84a62318f010f8361e94120f579fe24eca5d0ae7efc3cabe7175817f6ce799857ce95abbf59acfe3d898396464cd55231b2d29fd80dbfe781a9a561401e87312
6
+ metadata.gz: e5a7d941184da2cc685816c9f1b7a895686b4c915502455e6576a317d1451f3eb2cf696d9891c835a2e929c090053d25450da8548f6efd95043de114b5a36441
7
+ data.tar.gz: 0efce415cf6e84eff032d114ee0c25de76cf964c56359c1e018325c6d4dfb8c2de0afca63549ba6754fff18825fd50151018fee4bc3c95d78d3c7213dfb7f083
@@ -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.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,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.29.0
4
+
5
+ * Updates standard-performance to [1.1.0](https://github.com/standardrb/standard-performacne/releases/tag/v1.1.0)
6
+ * Updates rubocop to [1.52.0](https://github.com/rubocop/rubocop/releases/tag/v1.52.0)
7
+ * Enables Style/ExactRegexpMatch, Style/RedundantArrayConstructor, Style/RedundantFilterChain, Style/RedundantRegexpConstructor
8
+
9
+ ## 1.28.5
10
+
11
+ * Make LSP behave more nicely with nvim-lspconfig [#564](https://github.com/standardrb/standard/pull/564)
12
+
13
+ ## 1.28.4
14
+
15
+ * Fix [standard-rails#7](https://github.com/standardrb/standard-rails/issues/7#issuecomment-1563505365)
16
+
17
+ ## 1.28.3
18
+
19
+ * Older ruby support fixes from [@pboling](https://github.com/pboling):
20
+ - [#559](https://github.com/standardrb/standard/issues/559)
21
+ - [#561](https://github.com/standardrb/standard/issues/560)
22
+ - [#561](https://github.com/standardrb/standard/issues/561)
23
+
24
+ ## 1.28.2
25
+
26
+ * Attempts to fix the not-actually fixed plugin behavior in 1.28.1
27
+
28
+ ## 1.28.1
29
+
30
+ * Fixes plugin behavior caused by setting `DisabledByDefault: true` in `AllCops`
31
+ Effectively, a single lint_roller plugin whose `rules` were of type `:object`
32
+ would inadvertently mark all previously-defined rules as invalid.
33
+ [#557](https://github.com/standardrb/standard/pull/557)
34
+
3
35
  ## 1.28.0
4
36
 
5
37
  * Refactor Standard into 3 gems and convert all built-in configuration into
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (1.28.0)
4
+ standard (1.29.0)
5
5
  language_server-protocol (~> 3.17.0.2)
6
6
  lint_roller (~> 1.0)
7
- rubocop (~> 1.50.2)
7
+ rubocop (~> 1.52.0)
8
8
  standard-custom (~> 1.0.0)
9
- standard-performance (~> 1.0.1)
9
+ standard-performance (~> 1.1.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
@@ -23,13 +23,13 @@ GEM
23
23
  method_source (1.0.0)
24
24
  minitest (5.18.0)
25
25
  parallel (1.23.0)
26
- parser (3.2.2.0)
26
+ parser (3.2.2.1)
27
27
  ast (~> 2.4.1)
28
28
  rainbow (3.1.1)
29
29
  rake (13.0.6)
30
30
  regexp_parser (2.8.0)
31
31
  rexml (3.2.5)
32
- rubocop (1.50.2)
32
+ rubocop (1.52.0)
33
33
  json (~> 2.3)
34
34
  parallel (~> 1.10)
35
35
  parser (>= 3.2.0.0)
@@ -39,9 +39,9 @@ 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.29.0)
43
43
  parser (>= 3.2.1.0)
44
- rubocop-performance (1.16.0)
44
+ rubocop-performance (1.18.0)
45
45
  rubocop (>= 1.7.0, < 2.0)
46
46
  rubocop-ast (>= 0.4.0)
47
47
  ruby-progressbar (1.13.0)
@@ -53,9 +53,9 @@ GEM
53
53
  simplecov_json_formatter (0.1.4)
54
54
  standard-custom (1.0.0)
55
55
  lint_roller (~> 1.0)
56
- standard-performance (1.0.1)
56
+ standard-performance (1.1.0)
57
57
  lint_roller (~> 1.0)
58
- rubocop-performance (~> 1.16.0)
58
+ rubocop-performance (~> 1.18.0)
59
59
  unicode-display_width (2.4.2)
60
60
 
61
61
  PLATFORMS
data/README.md CHANGED
@@ -15,7 +15,7 @@ supports plugins built with
15
15
 
16
16
  Standard Ruby was created and is maintained by the team at [Test
17
17
  Double](https://testdouble.com), because we appreciate the importance of
18
- balancing predictably consistent code with preserving developers' autonomy. 💚
18
+ balancing predictable, consistent code with preserving developer autonomy. 💚
19
19
 
20
20
  Topics covered in this README:
21
21
 
@@ -37,7 +37,7 @@ ever agree on what all the rules and format should be.**
37
37
 
38
38
  This has resulted in innumerable teams arguing how to configure their linters
39
39
  and formatters over literal decades. Some teams routinely divert time and energy
40
- from whatever they're building to reach concensus on where commas should go.
40
+ from whatever they're building to reach consensus on where commas should go.
41
41
  Other teams have an overzealous tech lead who sets up everything _his favorite
42
42
  way_ and then imposes his will on others. It's not uncommon to witness
43
43
  passive-aggressive programmers change a contentious rule back-and-forth,
@@ -63,9 +63,9 @@ for most of the ways people use Ruby, most of the time.
63
63
 
64
64
  If you adopt Standard Ruby, what's in it for you? Time saved that would've been
65
65
  spent arguing over how to set things up. Also, seamless upgrades: we stay on top
66
- of each new RuboCop rule ship an updated configuration on a monthly release
66
+ of each new RuboCop rule and update our configuration on a monthly release
67
67
  cadence. But the best part of adopting Standard as your linter and formatter?
68
- You'll spend a whole lot less time thinking about linters and formatters.
68
+ **You'll spend a whole lot less time thinking about linters and formatters.**
69
69
 
70
70
  So please, give Standard Ruby a try. If you're like [these
71
71
  folks](#who-uses-standard-ruby), you'll soon realize that the value of a linter
@@ -110,7 +110,7 @@ A majority of Standard's rules can be safely fixed automatically.
110
110
 
111
111
  ```
112
112
  # CLI
113
- $ standard --fix
113
+ $ standardrb --fix
114
114
 
115
115
  # Rake
116
116
  $ rake standard:fix
@@ -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/base.yml CHANGED
@@ -1153,6 +1153,8 @@ Style/EvalWithLocation:
1153
1153
  Style/EvenOdd:
1154
1154
  Enabled: false
1155
1155
 
1156
+ Style/ExactRegexpMatch:
1157
+ Enabled: true
1156
1158
  Style/ExpandPathArguments:
1157
1159
  Enabled: false
1158
1160
 
@@ -1498,6 +1500,9 @@ Style/RandomWithOffset:
1498
1500
  Style/RedundantArgument:
1499
1501
  Enabled: false
1500
1502
 
1503
+ Style/RedundantArrayConstructor:
1504
+ Enabled: true
1505
+
1501
1506
  Style/RedundantAssignment:
1502
1507
  Enabled: true
1503
1508
 
@@ -1531,6 +1536,9 @@ Style/RedundantFetchBlock:
1531
1536
  Style/RedundantFileExtensionInRequire:
1532
1537
  Enabled: true
1533
1538
 
1539
+ Style/RedundantFilterChain:
1540
+ Enabled: false
1541
+
1534
1542
  Style/RedundantFreeze:
1535
1543
  Enabled: true
1536
1544
 
@@ -1555,6 +1563,9 @@ Style/RedundantPercentQ:
1555
1563
  Style/RedundantRegexpCharacterClass:
1556
1564
  Enabled: true
1557
1565
 
1566
+ Style/RedundantRegexpConstructor:
1567
+ Enabled: true
1568
+
1558
1569
  Style/RedundantRegexpEscape:
1559
1570
  Enabled: true
1560
1571
 
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-1.9.yml CHANGED
@@ -5,3 +5,7 @@ Style/Encoding:
5
5
 
6
6
  Style/HashConversion:
7
7
  Enabled: false
8
+
9
+ # Percent delimiters are not supported until Ruby 2.0
10
+ Style/PercentLiteralDelimiters:
11
+ 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
@@ -19,9 +19,9 @@ module Standard
19
19
  RuboCop::ConfigStore.new.tap do |config_store|
20
20
  options_config = @assigns_rubocop_yaml.call(config_store, standard_config)
21
21
  @sets_target_ruby_version.call(options_config, standard_config)
22
- @configures_ignored_paths.call(options_config, standard_config)
23
22
  @combines_plugin_configs.call(options_config, standard_config)
24
23
  @merges_user_config_extensions.call(options_config, standard_config)
24
+ @configures_ignored_paths.call(options_config, standard_config)
25
25
  end
26
26
  end
27
27
  end
@@ -75,6 +75,10 @@ module Standard
75
75
  @writer.write({id: request[:id], result: format_file(uri)})
76
76
  end
77
77
 
78
+ handle "workspace/didChangeConfiguration" do |_request|
79
+ @logger.puts "Ignoring workspace/didChangeConfiguration"
80
+ end
81
+
78
82
  handle "workspace/didChangeWatchedFiles" do |request|
79
83
  if request[:params][:changes].any? { |change| change[:uri].end_with?(".standard.yml") }
80
84
  @logger.puts "Configuration file changed; restart required"
@@ -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
@@ -60,7 +59,8 @@ module Standard
60
59
  if rules.type == :path
61
60
  [RuboCop::ConfigLoader.load_file(rules.value), rules.value]
62
61
  elsif rules.type == :object
63
- [RuboCop::Config.new(rules.value), nil]
62
+ path = plugin.method(:rules).source_location[0]
63
+ [RuboCop::Config.create(rules.value, path, check: true), path]
64
64
  elsif rules.type == :error
65
65
  raise "Plugin `#{plugin.about&.name || plugin.inspect}' failed to load with error: #{rules.value.respond_to?(:message) ? rules.value.message : rules.value}"
66
66
  end
@@ -123,13 +123,32 @@ module Standard
123
123
  end
124
124
  end
125
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
+
126
134
  def fake_out_rubocop_default_configuration(options_config)
127
- og_default_config = RuboCop::ConfigLoader.instance_variable_get(:@default_configuration)
135
+ og_default_config = RuboCop::ConfigLoader.default_configuration
136
+ set_target_rails_version_on_all_cops_because_its_technically_not_allowed!(options_config)
128
137
  result = yield blank_rubocop_config(options_config)
129
138
  RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, og_default_config)
130
139
  result
131
140
  end
132
141
 
142
+ # Avoid a warning that would otherwise be emitted by any plugin that set TargetRailsVersion
143
+ # because it's not a default AllCops key specified in RuboCop's embedded default config.
144
+ #
145
+ # See: https://github.com/rubocop/rubocop/pull/11833
146
+ def set_target_rails_version_on_all_cops_because_its_technically_not_allowed!(options_config)
147
+ return if !options_config.key?("AllCops") || options_config["AllCops"].key?("TargetRailsVersion")
148
+
149
+ options_config["AllCops"]["TargetRailsVersion"] = nil
150
+ end
151
+
133
152
  def blank_rubocop_config(example_config)
134
153
  RuboCop::Config.new(example_config.to_h.slice(*MANDATORY_RUBOCOP_CONFIG_KEYS), "")
135
154
  end
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("1.28.0")
2
+ VERSION = Gem::Version.new("1.29.0")
3
3
  end
data/standard.gemspec CHANGED
@@ -23,11 +23,11 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
  spec.metadata["rubygems_mfa_required"] = "true"
25
25
 
26
- spec.add_dependency "rubocop", "~> 1.50.2"
26
+ spec.add_dependency "rubocop", "~> 1.52.0"
27
27
 
28
28
  spec.add_dependency "lint_roller", "~> 1.0"
29
29
  spec.add_dependency "standard-custom", "~> 1.0.0"
30
- spec.add_dependency "standard-performance", "~> 1.0.1"
30
+ spec.add_dependency "standard-performance", "~> 1.1.0"
31
31
 
32
32
  # not semver: first three are lsp protocol version, last is patch
33
33
  spec.add_dependency "language_server-protocol", "~> 3.17.0.2"
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.0
4
+ version: 1.29.0
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-04-22 00:00:00.000000000 Z
11
+ date: 2023-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.50.2
19
+ version: 1.52.0
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.50.2
26
+ version: 1.52.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: lint_roller
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.1
61
+ version: 1.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.1
68
+ version: 1.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: language_server-protocol
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.17.0.2
83
- description:
83
+ description:
84
84
  email:
85
85
  - searls@gmail.com
86
86
  executables:
@@ -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
@@ -166,7 +167,7 @@ metadata:
166
167
  source_code_uri: https://github.com/standardrb/standard
167
168
  changelog_uri: https://github.com/standardrb/standard/blob/main/CHANGELOG.md
168
169
  rubygems_mfa_required: 'true'
169
- post_install_message:
170
+ post_install_message:
170
171
  rdoc_options: []
171
172
  require_paths:
172
173
  - lib
@@ -181,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  - !ruby/object:Gem::Version
182
183
  version: '0'
183
184
  requirements: []
184
- rubygems_version: 3.4.10
185
- signing_key:
185
+ rubygems_version: 3.1.6
186
+ signing_key:
186
187
  specification_version: 4
187
188
  summary: Ruby Style Guide, with linter & automatic code fixer
188
189
  test_files: []