standard 1.40.0 → 1.51.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: 11a5e687261fb830d043558db4065c4533725a5997b1b70b3ba2b7656410fc2b
4
- data.tar.gz: 1a38f3258931be3002752d726bcae77caf6e6dedb92b7e758cf65052b6db0464
3
+ metadata.gz: 07c40762e88776ff266e671bb0e0f9985b2017e91b99ff1593c24b7909663325
4
+ data.tar.gz: 65eebc32148755c1fa6fd98bfd24219f97f30466c8bff2edd360637d789c4118
5
5
  SHA512:
6
- metadata.gz: 399225a5d25d05fbef38bc7008801a680c48fc89c139820010ddd0ceffdc39008a1ec405dfe0ad414a43032d1c2227a0fb487618ce0f67bffe28cffa3afe35f5
7
- data.tar.gz: feedd6180c2d564c3e0126e7f6f83731f8b029421030b7263f810e531b26943d5deec44247a8a6b136d3881b38c853762838e79742899ce091b1bf787201d893
6
+ metadata.gz: 77d7ef4b4a63e4bd9c5fcc834a669db73d83299ae398e44424d5634b2507ed86910e4464ef487a8aaa6fe5aca1a73c7ba381ad9639532ebb9f65c4a53fc97873
7
+ data.tar.gz: '0048c371fc119bc358eb9603e6ec41fbdc136a7d17776f4a3ffcfc8144d8c125cb6e65de77c996b9638321392cbed1d12f12b47f8e405011bd3593db07266228'
@@ -1,10 +1,11 @@
1
+ # Please see the documentation for all configuration options:
2
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3
+
1
4
  version: 2
2
5
  updates:
3
- - package-ecosystem: "bundler"
6
+ - package-ecosystem: bundler
4
7
  directory: "/"
5
- allow:
6
- - dependency-name: "rubocop"
7
- - dependency-name: "rubocop-performance"
8
- schedule:
9
- interval: "weekly"
10
- day: monday
8
+ schedule: { interval: weekly, day: monday }
9
+ - package-ecosystem: github-actions
10
+ directory: "/"
11
+ schedule: { interval: weekly }
@@ -2,34 +2,23 @@ name: Tests
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [main]
6
5
  pull_request:
7
- branches: [main]
6
+ workflow_dispatch:
7
+ schedule: [ cron: "42 0 7 * *" ] # https://crontab.guru/#42_0_7_*_*
8
8
  workflow_run:
9
- workflows: ["Update"]
10
- types:
11
- - completed
9
+ workflows: [ "Update" ]
10
+ types: [ completed ]
12
11
 
13
12
  jobs:
14
13
  test:
15
-
16
- strategy:
17
- matrix:
18
- os: [ubuntu-latest]
19
- ruby-version:
20
- - '3.0'
21
- - '3.1'
22
- - '3.2'
23
- - '3.3'
24
-
25
- runs-on: ${{ matrix.os }}
26
-
14
+ runs-on: ubuntu-latest
15
+ strategy: {matrix: {ruby: [ '3.0', 3.1, 3.2, 3.3, 3.4 ]}}
27
16
  steps:
28
- - uses: actions/checkout@v4
29
- - name: Set up Ruby ${{ matrix.ruby-version }}
30
- uses: ruby/setup-ruby@v1
17
+ - uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
18
+ with: { egress-policy: audit }
19
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
31
21
  with:
32
- ruby-version: ${{ matrix.ruby-version }}
22
+ ruby-version: ${{ matrix.ruby }}
33
23
  bundler-cache: true
34
- - name: Run tests for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
35
- run: bundle config unset deployment && bundle exec rake
24
+ - run: bin/rake
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
 
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@v5
18
18
  - name: Set up Ruby
19
19
  uses: ruby/setup-ruby@v1
20
20
  with:
@@ -45,7 +45,7 @@ jobs:
45
45
  id: date
46
46
  run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
47
47
  - name: Create Pull Request
48
- uses: peter-evans/create-pull-request@v6
48
+ uses: peter-evans/create-pull-request@v7
49
49
  with:
50
50
  reviewers: camilopayan
51
51
  commit-message: '[ ${{ steps.date.outputs.date }} ] - Update dependencies'
data/CHANGELOG.md CHANGED
@@ -1,6 +1,68 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 1.51.1
4
+
5
+ * Fixes Layout/EmptyLineAfterGuardClause back to false after [#750](https://github.com/standardrb/standard/issues/750)
6
+
7
+ ## 1.51.0
8
+
9
+ * Updates rubocop to [1.81.2](https://github.com/rubocop/rubocop/tree/v1.81.2)
10
+
11
+ ## 1.50.0
12
+
13
+ * Updates rubocop to [1.75.5](https://github.com/rubocop/rubocop/tree/v1.75.5)
14
+
15
+ ## 1.49.0
16
+
17
+ * Updates standard performance to 1.8.0
18
+
19
+ ## 1.48.0
20
+
21
+ * Updates rubocop to [1.75.2](https://github.com/rubocop/rubocop/tree/v1.75.2)
22
+
23
+ ## 1.47.0
24
+
25
+ * Updates standard performance to 1.7.0
26
+
27
+ ## 1.46.0
28
+
29
+ * Updates rubocop to [1.73.2](https://github.com/rubocop/rubocop/tree/v1.73.2)
30
+
31
+ ## 1.45.0
32
+
33
+ * Updates rubocop to [1.71.0](https://github.com/rubocop/rubocop/tree/v1.71.0)
34
+
35
+ ## 1.44.0
36
+
37
+ * Updates rubocop to [1.70.0](https://github.com/rubocop/rubocop/tree/v1.70.0)
38
+
39
+ ## 1.43.0
40
+
41
+ * Updates rubocop to [1.69.1](https://github.com/rubocop/rubocop/tree/v1.69.1)
42
+
43
+ ## 1.42.1
44
+
45
+ * Fixes a very noisy typo!
46
+
47
+ ## 1.42.0
48
+
49
+ * Updates rubocop to [1.68.0](https://github.com/rubocop/rubocop/tree/v1.68.0)
50
+ * Inherit from `RuboCop::Cop::Base` fixing deprecation warnings.
51
+ * Add new cops
52
+
53
+ ## 1.41.1
54
+
55
+ * Adds a stub method to the Ruby LSP add-on to avoid a potential runtime exception
56
+ for range formatting requests [#655](https://github.com/standardrb/standard/pull/655)
57
+
58
+ ## 1.41.0
59
+
60
+ * Updates rubocop to [1.66.1](https://github.com/rubocop/rubocop/releases/tag/v1.66.1)
61
+ * Updates standard-performance to [1.5.0](https://github.com/standardrb/standard-performance/releases/tag/v1.5.0)
62
+
63
+ ## 1.40.1
64
+
65
+ * Fix error handling in LSP Server 84ee9f4
4
66
 
5
67
  ## 1.40.0
6
68
 
data/Gemfile CHANGED
@@ -3,15 +3,14 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem "bundler"
6
- gem "minitest", "~> 5.0"
7
- gem "rake", "~> 13.0"
8
6
  gem "m"
7
+ gem "minitest"
9
8
  gem "mutex_m"
9
+ gem "rake"
10
10
  gem "ruby-lsp"
11
+ gem "simplecov"
11
12
 
12
13
  # You may want to run these off path locally:
13
14
  # gem "lint_roller", path: "../lint_roller"
14
15
  # gem "standard-custom", path: "../standard-custom"
15
16
  # gem "standard-performance", path: "../standard-performance"
16
-
17
- gem "simplecov"
data/Gemfile.lock CHANGED
@@ -1,76 +1,77 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (1.40.0)
4
+ standard (1.51.1)
5
5
  language_server-protocol (~> 3.17.0.2)
6
6
  lint_roller (~> 1.0)
7
- rubocop (~> 1.65.0)
7
+ rubocop (~> 1.80.2)
8
8
  standard-custom (~> 1.0.0)
9
- standard-performance (~> 1.4)
9
+ standard-performance (~> 1.8)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- ast (2.4.2)
14
+ ast (2.4.3)
15
15
  docile (1.4.0)
16
- json (2.6.3)
17
- language_server-protocol (3.17.0.3)
16
+ json (2.13.2)
17
+ language_server-protocol (3.17.0.5)
18
18
  lint_roller (1.1.0)
19
- logger (1.6.0)
19
+ logger (1.7.0)
20
20
  m (1.6.2)
21
21
  method_source (>= 0.6.7)
22
22
  rake (>= 0.9.2.2)
23
23
  method_source (1.0.0)
24
- minitest (5.20.0)
25
- mutex_m (0.2.0)
26
- parallel (1.23.0)
27
- parser (3.3.0.5)
24
+ minitest (5.25.5)
25
+ mutex_m (0.3.0)
26
+ parallel (1.27.0)
27
+ parser (3.3.9.0)
28
28
  ast (~> 2.4.1)
29
29
  racc
30
- prism (0.30.0)
31
- racc (1.7.1)
30
+ prism (1.4.0)
31
+ racc (1.8.1)
32
32
  rainbow (3.1.1)
33
- rake (13.0.6)
34
- rbs (3.5.2)
33
+ rake (13.3.0)
34
+ rbs (3.6.1)
35
35
  logger
36
- regexp_parser (2.8.2)
37
- rexml (3.2.6)
38
- rubocop (1.65.1)
36
+ regexp_parser (2.11.2)
37
+ rubocop (1.80.2)
39
38
  json (~> 2.3)
40
- language_server-protocol (>= 3.17.0)
39
+ language_server-protocol (~> 3.17.0.2)
40
+ lint_roller (~> 1.1.0)
41
41
  parallel (~> 1.10)
42
42
  parser (>= 3.3.0.2)
43
43
  rainbow (>= 2.2.2, < 4.0)
44
- regexp_parser (>= 2.4, < 3.0)
45
- rexml (>= 3.2.5, < 4.0)
46
- rubocop-ast (>= 1.31.1, < 2.0)
44
+ regexp_parser (>= 2.9.3, < 3.0)
45
+ rubocop-ast (>= 1.46.0, < 2.0)
47
46
  ruby-progressbar (~> 1.7)
48
- unicode-display_width (>= 2.4.0, < 3.0)
49
- rubocop-ast (1.31.2)
50
- parser (>= 3.3.0.4)
51
- rubocop-performance (1.21.0)
52
- rubocop (>= 1.48.1, < 2.0)
53
- rubocop-ast (>= 1.31.1, < 2.0)
54
- ruby-lsp (0.17.7)
47
+ unicode-display_width (>= 2.4.0, < 4.0)
48
+ rubocop-ast (1.46.0)
49
+ parser (>= 3.3.7.2)
50
+ prism (~> 1.4)
51
+ rubocop-performance (1.25.0)
52
+ lint_roller (~> 1.1)
53
+ rubocop (>= 1.75.0, < 2.0)
54
+ rubocop-ast (>= 1.38.0, < 2.0)
55
+ ruby-lsp (0.26.1)
55
56
  language_server-protocol (~> 3.17.0)
56
- prism (>= 0.29.0, < 0.31)
57
- rbs (>= 3, < 4)
58
- sorbet-runtime (>= 0.5.10782)
57
+ prism (>= 1.2, < 2.0)
58
+ rbs (>= 3, < 5)
59
59
  ruby-progressbar (1.13.0)
60
60
  simplecov (0.22.0)
61
61
  docile (~> 1.1)
62
62
  simplecov-html (~> 0.11)
63
63
  simplecov_json_formatter (~> 0.1)
64
- simplecov-html (0.12.3)
64
+ simplecov-html (0.13.1)
65
65
  simplecov_json_formatter (0.1.4)
66
- sorbet-runtime (0.5.11481)
67
66
  standard-custom (1.0.2)
68
67
  lint_roller (~> 1.0)
69
68
  rubocop (~> 1.50)
70
- standard-performance (1.4.0)
69
+ standard-performance (1.8.0)
71
70
  lint_roller (~> 1.1)
72
- rubocop-performance (~> 1.21.0)
73
- unicode-display_width (2.5.0)
71
+ rubocop-performance (~> 1.25.0)
72
+ unicode-display_width (3.1.5)
73
+ unicode-emoji (~> 4.0, >= 4.0.4)
74
+ unicode-emoji (4.0.4)
74
75
 
75
76
  PLATFORMS
76
77
  ruby
@@ -79,12 +80,12 @@ PLATFORMS
79
80
  DEPENDENCIES
80
81
  bundler
81
82
  m
82
- minitest (~> 5.0)
83
+ minitest
83
84
  mutex_m
84
- rake (~> 13.0)
85
+ rake
85
86
  ruby-lsp
86
87
  simplecov
87
88
  standard!
88
89
 
89
90
  BUNDLED WITH
90
- 2.4.12
91
+ 2.5.23
data/README.md CHANGED
@@ -153,13 +153,16 @@ continuous integration systems.
153
153
 
154
154
  We've added a number of editing guides for getting started:
155
155
 
156
- - [VS Code](https://github.com/standardrb/standard/wiki/IDE:-vscode)
157
- - [vim](https://github.com/standardrb/standard/wiki/IDE:-vim)
156
+ - [Atom](https://github.com/standardrb/standard/wiki/IDE:-Atom)
157
+ - [emacs](https://www.flycheck.org/en/latest/languages.html#syntax-checker-ruby-standard)
158
+ - [Helix](https://github.com/helix-editor/helix/wiki/Formatter-configurations#standardrb)
158
159
  - [neovim](https://github.com/standardrb/standard/wiki/IDE:-neovim)
160
+ - [Nova](https://codeberg.org/edwardloveall/nova-standard)
159
161
  - [RubyMine](https://www.jetbrains.com/help/ruby/rubocop.html#disable_rubocop)
160
- - [emacs](https://www.flycheck.org/en/latest/languages.html#syntax-checker-ruby-standard)
161
- - [Helix](https://github.com/helix-editor/helix/wiki/External-formatter-configuration#standardrb)
162
- - [Atom](https://github.com/standardrb/standard/wiki/IDE:-Atom)
162
+ - [vim](https://github.com/standardrb/standard/wiki/IDE:-vim)
163
+ - [VS Code](https://github.com/standardrb/standard/wiki/IDE:-vscode)
164
+ - [Zed](https://zed.dev/docs/languages/ruby#setting-up-ruby-lsp)
165
+ - [Sublime Text](https://github.com/standardrb/standard/wiki/IDE:-Sublime-Text)
163
166
 
164
167
  If you'd like to help by creating a guide, please draft one [in an
165
168
  issue](https://github.com/standardrb/standard/issues/new) and we'll get it
@@ -502,6 +505,7 @@ Here are a few examples of Ruby Standard-compliant teams & projects:
502
505
  * [Honeybadger](https://www.honeybadger.io)
503
506
  * [JetThoughts](https://www.jetthoughts.com/)
504
507
  * [Level UP Solutions](https://levups.com)
508
+ * [Lobsters](https://github.com/lobsters/lobsters)
505
509
  * [Monterail](https://www.monterail.com)
506
510
  * [myRent](https://www.myrent.co.nz)
507
511
  * [OBLSK](https://oblsk.com/)
@@ -509,6 +513,7 @@ Here are a few examples of Ruby Standard-compliant teams & projects:
509
513
  * [Planet Argon](https://www.planetargon.com/)
510
514
  * [PLT4M](https://plt4m.com/)
511
515
  * [Podia](https://www.podia.com/)
516
+ * [Privy](https://www.privy.com/)
512
517
  * [Rebase Interactive](https://www.rebaseinteractive.com/)
513
518
  * [Renuo](https://www.renuo.ch/)
514
519
  * [RubyCI](https://ruby.ci)
data/Rakefile CHANGED
@@ -1,10 +1,13 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rake/clean"
2
3
  require "rake/testtask"
3
4
  require_relative "lib/standard/rake"
4
5
 
6
+ CLOBBER.include "*.gem"
7
+
8
+ task default: [:test, "standard:fix"]
9
+
5
10
  Rake::TestTask.new(:test) do |t|
6
11
  t.warning = false
7
12
  t.test_files = FileList["test/**/*_test.rb"]
8
13
  end
9
-
10
- task default: [:test, "standard:fix"]
data/bin/rake ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rake", "rake")
data/config/base.yml CHANGED
@@ -30,6 +30,9 @@ Bundler/OrderedGems:
30
30
  Gemspec/AddRuntimeDependency:
31
31
  Enabled: false
32
32
 
33
+ Gemspec/AttributeAssignment:
34
+ Enabled: false
35
+
33
36
  Gemspec/DependencyVersion:
34
37
  Enabled: false
35
38
 
@@ -132,12 +135,15 @@ Layout/EmptyLineAfterMultilineCondition:
132
135
 
133
136
  Layout/EmptyLineBetweenDefs:
134
137
  Enabled: true
135
- AllowAdjacentOneLineDefs: false
138
+ AllowAdjacentOneLineDefs: true
136
139
  NumberOfEmptyLines: 1
137
140
 
138
141
  Layout/EmptyLines:
139
142
  Enabled: true
140
143
 
144
+ Layout/EmptyLinesAfterModuleInclusion:
145
+ Enabled: true
146
+
141
147
  Layout/EmptyLinesAroundAccessModifier:
142
148
  Enabled: true
143
149
 
@@ -243,6 +249,7 @@ Layout/InitialIndentation:
243
249
 
244
250
  Layout/LeadingCommentSpace:
245
251
  Enabled: true
252
+ AllowRBSInlineAnnotation: true
246
253
 
247
254
  Layout/LeadingEmptyLines:
248
255
  Enabled: true
@@ -439,6 +446,10 @@ Lint/AmbiguousRange:
439
446
  Lint/AmbiguousRegexpLiteral:
440
447
  Enabled: true
441
448
 
449
+ Lint/ArrayLiteralInRegexp:
450
+ Enabled: true
451
+ AutoCorrect: false
452
+
442
453
  Lint/AssignmentInCondition:
443
454
  Enabled: true
444
455
  AllowSafeAssignment: true
@@ -464,9 +475,15 @@ Lint/ConstantDefinitionInBlock:
464
475
  Lint/ConstantOverwrittenInRescue:
465
476
  Enabled: true
466
477
 
478
+ Lint/ConstantReassignment:
479
+ Enabled: true
480
+
467
481
  Lint/ConstantResolution:
468
482
  Enabled: false
469
483
 
484
+ Lint/CopDirectiveSyntax:
485
+ Enabled: true
486
+
470
487
  Lint/Debugger:
471
488
  Enabled: true
472
489
 
@@ -512,6 +529,9 @@ Lint/DuplicateRequire:
512
529
  Lint/DuplicateRescueException:
513
530
  Enabled: true
514
531
 
532
+ Lint/DuplicateSetElement:
533
+ Enabled: false
534
+
515
535
  Lint/EachWithObjectArgument:
516
536
  Enabled: true
517
537
 
@@ -567,6 +587,9 @@ Lint/FormatParameterMismatch:
567
587
  Lint/HashCompareByIdentity:
568
588
  Enabled: false
569
589
 
590
+ Lint/HashNewWithKeywordArgumentsAsDefault:
591
+ Enabled: true
592
+
570
593
  Lint/HeredocMethodCallPosition:
571
594
  Enabled: false
572
595
 
@@ -650,6 +673,9 @@ Lint/NumberConversion:
650
673
  Lint/NumberedParameterAssignment:
651
674
  Enabled: true
652
675
 
676
+ Lint/NumericOperationWithConstantResult:
677
+ Enabled: false
678
+
653
679
  Lint/OrAssignmentToConstant:
654
680
  Enabled: true
655
681
 
@@ -698,6 +724,9 @@ Lint/RedundantSplatExpansion:
698
724
  Lint/RedundantStringCoercion:
699
725
  Enabled: true
700
726
 
727
+ Lint/RedundantTypeConversion:
728
+ Enabled: true
729
+
701
730
  Lint/RedundantWithIndex:
702
731
  Enabled: true
703
732
 
@@ -768,12 +797,19 @@ Lint/ShadowedException:
768
797
  Lint/ShadowingOuterLocalVariable:
769
798
  Enabled: false
770
799
 
800
+ Lint/SharedMutableDefault:
801
+ Enabled: true
802
+
771
803
  Lint/StructNewOverride:
772
804
  Enabled: false
773
805
 
774
806
  Lint/SuppressedException:
775
807
  Enabled: false
776
808
 
809
+ Lint/SuppressedExceptionInNumberConversion:
810
+ Enabled: true
811
+ AutoCorrect: false
812
+
777
813
  Lint/SymbolConversion:
778
814
  Enabled: true
779
815
 
@@ -798,6 +834,9 @@ Lint/TripleQuotes:
798
834
  Lint/UnderscorePrefixedVariableName:
799
835
  Enabled: true
800
836
 
837
+ Lint/UnescapedBracketInRegexp:
838
+ Enabled: false
839
+
801
840
  Lint/UnexpectedBlockArity:
802
841
  Enabled: false
803
842
 
@@ -831,12 +870,27 @@ Lint/UselessAccessModifier:
831
870
  Lint/UselessAssignment:
832
871
  Enabled: true
833
872
 
873
+ Lint/UselessConstantScoping:
874
+ Enabled: false
875
+
876
+ Lint/UselessDefaultValueArgument:
877
+ Enabled: false
878
+
879
+ Lint/UselessDefined:
880
+ Enabled: true
881
+
834
882
  Lint/UselessElseWithoutRescue:
835
883
  Enabled: false
836
884
 
837
885
  Lint/UselessMethodDefinition:
838
886
  Enabled: false
839
887
 
888
+ Lint/UselessNumericOperation:
889
+ Enabled: false
890
+
891
+ Lint/UselessOr:
892
+ Enabled: true
893
+
840
894
  Lint/UselessRescue:
841
895
  Enabled: true
842
896
 
@@ -933,7 +987,10 @@ Naming/MethodName:
933
987
  Naming/MethodParameterName:
934
988
  Enabled: false
935
989
 
936
- Naming/PredicateName:
990
+ Naming/PredicateMethod:
991
+ Enabled: false
992
+
993
+ Naming/PredicatePrefix:
937
994
  Enabled: false
938
995
 
939
996
  Naming/RescuedExceptionsVariableName:
@@ -977,11 +1034,14 @@ Style/Alias:
977
1034
  Enabled: true
978
1035
  EnforcedStyle: prefer_alias_method
979
1036
 
1037
+ Style/AmbiguousEndlessMethodDefinition:
1038
+ Enabled: false
1039
+
980
1040
  Style/AndOr:
981
1041
  Enabled: true
982
1042
 
983
1043
  Style/ArgumentsForwarding:
984
- Enabled: true
1044
+ Enabled: false
985
1045
 
986
1046
  Style/ArrayCoercion:
987
1047
  Enabled: false
@@ -1014,6 +1074,9 @@ Style/BeginBlock:
1014
1074
  Style/BisectedAttrAccessor:
1015
1075
  Enabled: false
1016
1076
 
1077
+ Style/BitwisePredicate:
1078
+ Enabled: false
1079
+
1017
1080
  Style/BlockComments:
1018
1081
  Enabled: true
1019
1082
 
@@ -1054,12 +1117,18 @@ Style/CollectionCompact:
1054
1117
  Style/CollectionMethods:
1055
1118
  Enabled: false
1056
1119
 
1120
+ Style/CollectionQuerying:
1121
+ Enabled: false
1122
+
1057
1123
  Style/ColonMethodCall:
1058
1124
  Enabled: true
1059
1125
 
1060
1126
  Style/ColonMethodDefinition:
1061
1127
  Enabled: true
1062
1128
 
1129
+ Style/CombinableDefined:
1130
+ Enabled: false
1131
+
1063
1132
  Style/CombinableLoops:
1064
1133
  Enabled: false
1065
1134
 
@@ -1074,6 +1143,9 @@ Style/CommentAnnotation:
1074
1143
  Style/CommentedKeyword:
1075
1144
  Enabled: false
1076
1145
 
1146
+ Style/ComparableBetween:
1147
+ Enabled: true
1148
+
1077
1149
  Style/ComparableClamp:
1078
1150
  Enabled: true
1079
1151
 
@@ -1101,6 +1173,9 @@ Style/DateTime:
1101
1173
  Style/DefWithParentheses:
1102
1174
  Enabled: true
1103
1175
 
1176
+ Style/DigChain:
1177
+ Enabled: true
1178
+
1104
1179
  Style/Dir:
1105
1180
  Enabled: true
1106
1181
 
@@ -1155,6 +1230,10 @@ Style/EmptyMethod:
1155
1230
  Enabled: true
1156
1231
  EnforcedStyle: expanded
1157
1232
 
1233
+ Style/EmptyStringInsideInterpolation:
1234
+ Enabled: true
1235
+ EnforcedStyle: trailing_conditional
1236
+
1158
1237
  Style/Encoding:
1159
1238
  Enabled: true
1160
1239
 
@@ -1190,9 +1269,15 @@ Style/FetchEnvVar:
1190
1269
  Style/FileEmpty:
1191
1270
  Enabled: false
1192
1271
 
1272
+ Style/FileNull:
1273
+ Enabled: true
1274
+
1193
1275
  Style/FileRead:
1194
1276
  Enabled: true
1195
1277
 
1278
+ Style/FileTouch:
1279
+ Enabled: false
1280
+
1196
1281
  Style/FileWrite:
1197
1282
  Enabled: true
1198
1283
 
@@ -1234,9 +1319,15 @@ Style/HashEachMethods:
1234
1319
  Style/HashExcept:
1235
1320
  Enabled: true
1236
1321
 
1322
+ Style/HashFetchChain:
1323
+ Enabled: false
1324
+
1237
1325
  Style/HashLikeCase:
1238
1326
  Enabled: false
1239
1327
 
1328
+ Style/HashSlice:
1329
+ Enabled: true
1330
+
1240
1331
  Style/HashSyntax:
1241
1332
  Enabled: true
1242
1333
  EnforcedStyle: ruby19_no_mixed_keys
@@ -1287,6 +1378,16 @@ Style/InvertibleUnlessCondition:
1287
1378
  Style/IpAddresses:
1288
1379
  Enabled: false
1289
1380
 
1381
+ Style/ItAssignment:
1382
+ Enabled: true
1383
+
1384
+ Style/ItBlockParameter:
1385
+ Enabled: true
1386
+ EnforcedStyle: only_numbered_parameters
1387
+
1388
+ Style/KeywordArgumentsMerging:
1389
+ Enabled: false
1390
+
1290
1391
  Style/KeywordParametersOrder:
1291
1392
  Enabled: true
1292
1393
 
@@ -1526,6 +1627,9 @@ Style/RedundantArgument:
1526
1627
  Style/RedundantArrayConstructor:
1527
1628
  Enabled: true
1528
1629
 
1630
+ Style/RedundantArrayFlatten:
1631
+ Enabled: true
1632
+
1529
1633
  Style/RedundantAssignment:
1530
1634
  Enabled: true
1531
1635
 
@@ -1565,6 +1669,9 @@ Style/RedundantFileExtensionInRequire:
1565
1669
  Style/RedundantFilterChain:
1566
1670
  Enabled: false
1567
1671
 
1672
+ Style/RedundantFormat:
1673
+ Enabled: true
1674
+
1568
1675
  Style/RedundantFreeze:
1569
1676
  Enabled: true
1570
1677
 
@@ -1577,6 +1684,9 @@ Style/RedundantInitialize:
1577
1684
  Style/RedundantInterpolation:
1578
1685
  Enabled: true
1579
1686
 
1687
+ Style/RedundantInterpolationUnfreeze:
1688
+ Enabled: true
1689
+
1580
1690
  Style/RedundantLineContinuation:
1581
1691
  Enabled: true
1582
1692
 
@@ -1649,6 +1759,9 @@ Style/SafeNavigation:
1649
1759
  - try
1650
1760
  - try!
1651
1761
 
1762
+ Style/SafeNavigationChainLength:
1763
+ Enabled: false
1764
+
1652
1765
  Style/Sample:
1653
1766
  Enabled: true
1654
1767
 
data/config/ruby-1.9.yml CHANGED
@@ -9,3 +9,6 @@ Style/HashConversion:
9
9
  # Percent delimiters are not supported until Ruby 2.0
10
10
  Style/PercentLiteralDelimiters:
11
11
  Enabled: false
12
+
13
+ Style/FileNull:
14
+ Enabled: false
data/config/ruby-2.2.yml CHANGED
@@ -6,6 +6,9 @@ AllCops:
6
6
  # The below cops are for features not available until Ruby 2.3 but,
7
7
  # as of this writing, the cops don't correctly use the TargetRubyVersion.
8
8
 
9
+ Style/HashFetchChain:
10
+ Enabled: false
11
+
9
12
  Layout/HeredocIndentation:
10
13
  Enabled: false
11
14
 
data/config/ruby-2.4.yml CHANGED
@@ -5,3 +5,6 @@ AllCops:
5
5
 
6
6
  Style/RedundantBegin:
7
7
  Enabled: false
8
+
9
+ Style/HashSlice:
10
+ Enabled: false
data/config/ruby-2.5.yml CHANGED
@@ -5,3 +5,6 @@ AllCops:
5
5
 
6
6
  Style/SlicingWithRange:
7
7
  Enabled: false
8
+
9
+ Lint/SuppressedExceptionInNumberConversion:
10
+ Enabled: false
data/config/ruby-2.7.yml CHANGED
@@ -5,3 +5,6 @@ AllCops:
5
5
 
6
6
  Style/HashExcept:
7
7
  Enabled: false
8
+
9
+ Style/RedundantInterpolationUnfreeze:
10
+ Enabled: false
data/config/ruby-3.1.yml CHANGED
@@ -7,5 +7,5 @@ Style/DataInheritance:
7
7
  Enabled: false
8
8
 
9
9
  Style/ArgumentsForwarding:
10
- Enabled: true
10
+ Enabled: false
11
11
  AllowOnlyRestArgument: true
data/config/ruby-3.3.yml CHANGED
@@ -2,3 +2,6 @@ inherit_from: ./base.yml
2
2
 
3
3
  AllCops:
4
4
  TargetRubyVersion: 3.3
5
+
6
+ Style/ItBlockParameter:
7
+ Enabled: false
data/docs/RELEASE.md CHANGED
@@ -15,13 +15,13 @@ rake install:local # Build and install standard-x.x.x.gem into system gems wi
15
15
  rake release[remote] # Create tag vx.x.x and build and push standard-0.5.2.gem to rubygems.org
16
16
  ```
17
17
 
18
- Most of these commands are depended on (read: run by) `rake release`, which is
18
+ Most of these commands are depended on (read: run by) `./bin/rake release`, which is
19
19
  really the only one we'll need for releasing the gem to
20
20
  [Rubygems.org](https://rubygems.org/gems/standard).
21
21
 
22
22
  ## Release steps
23
23
 
24
- 1. Make sure git is up to date and `bundle exec rake` exits cleanly
24
+ 1. Make sure git is up to date and `./bin/rake` exits cleanly
25
25
  1. If you upgraded a Rubocop dependency, be sure to lock it down in
26
26
  `standard.gemspec`. To avoid being broken transitively, we stick to exact
27
27
  release dependencies (e.g. "0.91.0" instead of "~> 0.91")
@@ -34,9 +34,8 @@ really the only one we'll need for releasing the gem to
34
34
  1. Run `bundle` so that Bundler writes this version to `Gemfile.lock`
35
35
  1. Commit `lib/standard/version.rb`, `Gemfile.lock`, and `CHANGELOG.md` together
36
36
  with the message equal to the new version (e.g. "0.42.1")
37
- 1. Finally, run `bundle exec rake release`, which will hopefully succeed
37
+ 1. Finally, run `./bin/rake release`, which will hopefully succeed
38
38
  1. Provide your multi-factor-auth token when prompted to finish publishing the
39
39
  gem
40
40
  1. [Tweet](https://twitter.com) about your awesome new release! (Shameless
41
41
  self-promotion is the most important part of open source software)
42
-
@@ -0,0 +1,51 @@
1
+ # Ruby versions
2
+
3
+ ## Handling new releases
4
+
5
+ When a new Ruby version comes out, you shouldn't have to make any immediate
6
+ changes to Standard Ruby. The default configuration is the `base.yml`
7
+ configuration and should continue to work correctly.
8
+
9
+ Often, Rubocop will add new rules to encourage usage of new language features in
10
+ new Ruby versions. When that happens:
11
+
12
+ 1. Add the rule to the `base.yml` file and disable it.
13
+ 1. Assess the new rule and see if it should be added to Standard Ruby. If not,
14
+ you're done. If so, enable it in `base.yml` and read on.
15
+ 1. Add a new config file for the penultimate minor version of Ruby. For example,
16
+ if the new version is `3.1` then the new config file would be for `3.0`.
17
+ 1. In the new config file, make sure it inherits from `base.yml` and disable the
18
+ new rule.
19
+ 1. In what was previously the latest config file, make sure it inherits from
20
+ your new config file.
21
+
22
+ That should add new rules to Standard Ruby safely and gracefully.
23
+
24
+ ## Maintenance and support
25
+
26
+ We will support the actively maintained ruby versions from the [ruby maintenance
27
+ policy](https://www.ruby-lang.org/en/downloads/branches/) along with the most
28
+ recently EOL version for an additional ~9 months, dropping support for EOL
29
+ versions around the time that a new supported ruby version is released and
30
+ added.
31
+
32
+ With the current ruby release cadence (new version near end of year, EOL drop
33
+ around April 1), this means we'll have a release of all the Standard gems around
34
+ the new year which adds support for the new ruby version and drops support for
35
+ what was an already-EOL but still-supported older ruby version.
36
+
37
+ ## Coordination across gems
38
+
39
+ We will align versions/dependencies amongst the Standard gems:
40
+
41
+ - [standard-custom](https://github.com/standardrb/standard-custom)
42
+ - [standard-performance](https://github.com/standardrb/standard-performance)
43
+ - [standard-rails](https://github.com/standardrb/standard-rails)
44
+ - [standard-sorbet](https://github.com/standardrb/standard-sorbet)
45
+ - [standard](https://github.com/standardrb/standard)
46
+
47
+ This means keeping them consistent in regard to:
48
+
49
+ - The minimum required ruby version configured in their `gemspec`
50
+ - Using that version in their internal `.standard.yml` configurations
51
+ - Including the full range of supported rubies in their CI ruby matrix
data/docs/UPGRADING.md CHANGED
@@ -11,21 +11,21 @@ The official standard plug-ins that are included in standard are:
11
11
 
12
12
  1. Update Rubocop plugin in the gemspec file and gem file.
13
13
  1. Keep standard in the gem file up-to-date. This will bring any testing utilities in standard into the plug-in repository.
14
- 1. Run bundle exec rake to run the tests
14
+ 1. Run `./bin/rake` to run the tests
15
15
  1. Configure any cops that need to be configured so that the tests pass
16
16
  1. Update the change log to the best of your ability and title it as unreleased
17
17
  1. Make your commit for these updates and push to the main branch
18
18
  1. Update the version in version.rb and update the version in the Changelog replacing the word “Unreleased”
19
19
  1. Run bundle to write the new version number to the lock file
20
- 1. Run bundle exec release to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.
20
+ 1. Run `./bin/rake release` to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.
21
21
 
22
22
  ## Updating Standard
23
23
 
24
24
  1. Update Rubocop as well as Standard Performance in the gemspec file and gem file.
25
- 1. Run bundle exec rake to run the tests
25
+ 1. Run `./bin/rake` to run the tests
26
26
  1. Configure any cops that need to be configured so that the tests pass
27
27
  1. Update the change log to the best of your ability and title it as unreleased
28
28
  1. Make your commit for these updates and push to the main branch
29
29
  1. Update the version in version.rb and update the version in the Changelog replacing the word “Unreleased”
30
30
  1. Run bundle to write the new version number to the lock file
31
- 1. Run bundle exec release to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.
31
+ 1. Run `./bin/rake` to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.
@@ -11,7 +11,7 @@ module RubyLsp
11
11
  def activate(global_state, message_queue)
12
12
  @logger = ::Standard::Lsp::Logger.new(prefix: "[Standard Ruby]")
13
13
  @logger.puts "Activating Standard Ruby LSP addon v#{::Standard::VERSION}"
14
- RuboCop::LSP.enable
14
+ ::RuboCop::LSP.enable
15
15
  @wraps_built_in_lsp_standardizer = WrapsBuiltinLspStandardizer.new
16
16
  global_state.register_formatter("standard", @wraps_built_in_lsp_standardizer)
17
17
  register_additional_file_watchers(global_state, message_queue)
@@ -2,6 +2,7 @@ module RubyLsp
2
2
  module Standard
3
3
  class WrapsBuiltinLspStandardizer
4
4
  include RubyLsp::Requests::Support::Formatter
5
+
5
6
  def initialize
6
7
  init!
7
8
  end
@@ -20,6 +21,13 @@ module RubyLsp
20
21
  @standardizer.offenses(uri_to_path(uri), document.source, document.encoding)
21
22
  end
22
23
 
24
+ def run_range_formatting(_uri, _partial_source, _base_indentation)
25
+ # Not yet supported. Should return the formatted version of `partial_source` which is a partial selection of the
26
+ # entire document. For example, it should not try to add a frozen_string_literal magic comment and all style
27
+ # corrections should start from the `base_indentation`
28
+ nil
29
+ end
30
+
23
31
  private
24
32
 
25
33
  # duplicated from: lib/standard/lsp/routes.rb
@@ -12,6 +12,7 @@ module Standard
12
12
 
13
13
  def puts_once(message)
14
14
  return if @puts_onces.include?(message)
15
+
15
16
  @puts_onces << message
16
17
  puts(message)
17
18
  end
@@ -42,11 +42,19 @@ module Standard
42
42
 
43
43
  raise Interrupt if aborting?
44
44
  rescue ::RuboCop::Runner::InfiniteCorrectionLoop => error
45
- raise RubyLsp::Requests::Formatting::Erro, error.message
45
+ if defined?(::RubyLsp::Requests::Formatting::Error)
46
+ raise ::RubyLsp::Requests::Formatting::Error, error.message
47
+ else
48
+ raise error
49
+ end
46
50
  rescue ::RuboCop::ValidationError => error
47
51
  raise ConfigurationError, error.message
48
52
  rescue => error
49
- raise ::RubyLsp::Requests::Support::InternalRuboCopError, error
53
+ if defined?(::RubyLsp::Requests::Formatting::Error)
54
+ raise ::RubyLsp::Requests::Support::InternalRuboCopError, error
55
+ else
56
+ raise error
57
+ end
50
58
  end
51
59
 
52
60
  def formatted_source
data/lib/standard/rake.rb CHANGED
@@ -25,7 +25,7 @@ task :"standard:fix" do
25
25
  fail unless exit_code == 0
26
26
  end
27
27
 
28
- desc "Lint and automatically make fixes (even unsafe ones!) with the Standard Ruby style guide"
28
+ desc "Lint and automatically make fixes (even unsafe ones) with the Standard Ruby style guide"
29
29
  task :"standard:fix_unsafely" do
30
30
  require "standard"
31
31
  exit_code = Standard::Cli.new(Standard::RakeSupport.argvify + ["--fix-unsafely"]).run
@@ -21,6 +21,7 @@ module Standard
21
21
 
22
22
  def argv_value_for(argv, option_name)
23
23
  return unless (index = argv.index(option_name))
24
+
24
25
  argv[index + 1]
25
26
  end
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("1.40.0")
2
+ VERSION = Gem::Version.new("1.51.1")
3
3
  end
data/standard.gemspec CHANGED
@@ -1,6 +1,4 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "standard/version"
1
+ require_relative "lib/standard/version"
4
2
 
5
3
  Gem::Specification.new do |spec|
6
4
  spec.name = "standard"
@@ -23,11 +21,11 @@ Gem::Specification.new do |spec|
23
21
  spec.require_paths = ["lib"]
24
22
  spec.metadata["rubygems_mfa_required"] = "true"
25
23
 
26
- spec.add_dependency "rubocop", "~> 1.65.0"
24
+ spec.add_dependency "rubocop", "~> 1.80.2"
27
25
 
28
26
  spec.add_dependency "lint_roller", "~> 1.0"
29
27
  spec.add_dependency "standard-custom", "~> 1.0.0"
30
- spec.add_dependency "standard-performance", "~> 1.4"
28
+ spec.add_dependency "standard-performance", "~> 1.8"
31
29
 
32
30
  # not semver: first three are lsp protocol version, last is patch
33
31
  spec.add_dependency "language_server-protocol", "~> 3.17.0.2"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.40.0
4
+ version: 1.51.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-08-13 00:00:00.000000000 Z
10
+ date: 2025-09-12 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rubocop
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 1.65.0
18
+ version: 1.80.2
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 1.65.0
25
+ version: 1.80.2
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: lint_roller
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +57,14 @@ dependencies:
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '1.4'
60
+ version: '1.8'
62
61
  type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '1.4'
67
+ version: '1.8'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: language_server-protocol
71
70
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +79,6 @@ dependencies:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
81
  version: 3.17.0.2
83
- description:
84
82
  email:
85
83
  - searls@gmail.com
86
84
  executables:
@@ -100,6 +98,7 @@ files:
100
98
  - README.md
101
99
  - Rakefile
102
100
  - bin/console
101
+ - bin/rake
103
102
  - bin/run
104
103
  - bin/setup
105
104
  - config/base.yml
@@ -119,8 +118,8 @@ files:
119
118
  - config/ruby-3.2.yml
120
119
  - config/ruby-3.3.yml
121
120
  - docs/ARCHITECTURE.md
122
- - docs/NEW_RUBIES.md
123
121
  - docs/RELEASE.md
122
+ - docs/RUBY_VERSIONS.md
124
123
  - docs/UPGRADING.md
125
124
  - exe/standardrb
126
125
  - lib/ruby_lsp/standard/addon.rb
@@ -173,7 +172,6 @@ metadata:
173
172
  source_code_uri: https://github.com/standardrb/standard
174
173
  changelog_uri: https://github.com/standardrb/standard/blob/main/CHANGELOG.md
175
174
  rubygems_mfa_required: 'true'
176
- post_install_message:
177
175
  rdoc_options: []
178
176
  require_paths:
179
177
  - lib
@@ -188,8 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
186
  - !ruby/object:Gem::Version
189
187
  version: '0'
190
188
  requirements: []
191
- rubygems_version: 3.4.10
192
- signing_key:
189
+ rubygems_version: 3.6.2
193
190
  specification_version: 4
194
191
  summary: Ruby Style Guide, with linter & automatic code fixer
195
192
  test_files: []
data/docs/NEW_RUBIES.md DELETED
@@ -1,13 +0,0 @@
1
- # Handling New Ruby Versions
2
-
3
- When a new Ruby version comes out, you shouldn't have to make any immediate changes to StandardRb. The default configuration is the `base.yml` configuration and should continue to work correctly.
4
-
5
- Often, Rubocop will add new rules to encourage usage of new language features in new Ruby versions. When that happens:
6
-
7
- 1. Add the rule to the base.yml file and disable it.
8
- 1. Assess the new rule and see if it should be added to StandardRb. If not, you're done. If so, enable in `base.yml` and read on.
9
- 1. Add a new config file for the penultimate minor version of Ruby, so for example, if the new Ruby version is `3.1` then the new config file would be for `3.0`.
10
- 1. In the new config file, make sure it inherits from `base.yml` and disable the new rule.
11
- 1. In the previous latest config file, make sure it inherits from your new config file.
12
-
13
- And that should add new rules to StandardRb safely and gracefully.