rubocop-sorbet 0.10.0 → 0.10.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: dc64043160fbb424294446cc5433eb9134d6b4dec111f858dcd759d3e2bd3b10
4
- data.tar.gz: 9f1f4fbacdcf92361cad0e52f5de2301b50ce6ac6d14c026a7508bd82f69e4bc
3
+ metadata.gz: 890d05a2b3a1bdbd0b1bc8e406c31563306732664faeb0f22b4ac3437017d0b1
4
+ data.tar.gz: c82de2c3757ebccb1ddb1955238c9e0005f2211887ef27e0118bc9ebd938d8a7
5
5
  SHA512:
6
- metadata.gz: cfd751a32647db87a95f58e8ec04ad2bd21042d527f85c228abb327255e9f7a5c0ae40206b3f228d6eb4a162a91910c4215339fb19613e9c81700f11a745e032
7
- data.tar.gz: 9e3dfc82ca705a74c52e6a8345b5e986bc0e66e8bedeb10f5d0ba4e65fa86e82afcd96e3eca41fb336ad903935e850f60335b346f9305f6b56fd97c9e4953ffd
6
+ metadata.gz: c1d3c14c1ef19f582bb01b768ba0e6110cb5c416da71128fb522839dc09798623e7c0e680842191908d62f9ca34c9228d05ee493acb6285e20cbba0738a078a9
7
+ data.tar.gz: 19c6a4eef2efec75790045a39c7bdd54360d43a700e30068ae0e77a872141e869832df04751a9f1b7db24f3801507c50927c4595cad09a7d42e9dc187097bbd9
@@ -0,0 +1,25 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
+ {
4
+ "name": "Ruby",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "ghcr.io/rails/devcontainer/images/ruby:3.4.3",
7
+ "features": {
8
+ "ghcr.io/devcontainers/features/github-cli:1": {}
9
+ }
10
+
11
+ // Features to add to the dev container. More info: https://containers.dev/features.
12
+ // "features": {},
13
+
14
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
15
+ // "forwardPorts": [],
16
+
17
+ // Use 'postCreateCommand' to run commands after the container is created.
18
+ // "postCreateCommand": "ruby --version",
19
+
20
+ // Configure tool-specific properties.
21
+ // "customizations": {},
22
+
23
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24
+ // "remoteUser": "root"
25
+ }
@@ -14,14 +14,14 @@ jobs:
14
14
  ruby: ["3.1", "3.2", "3.3", "3.4"]
15
15
  name: Test Ruby ${{ matrix.ruby }}
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18
18
  - name: Set up Ruby
19
- uses: ruby/setup-ruby@v1
19
+ uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
20
20
  with:
21
21
  ruby-version: ${{ matrix.ruby }}
22
22
  bundler-cache: true
23
23
  - name: Run tests
24
- run: bin/rspec
24
+ run: bin/rake test
25
25
 
26
26
  lint-and-docs:
27
27
  runs-on: ubuntu-latest
@@ -29,9 +29,9 @@ jobs:
29
29
  fail-fast: false
30
30
  name: Lint & Docs
31
31
  steps:
32
- - uses: actions/checkout@v4
32
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33
33
  - name: Set up Ruby
34
- uses: ruby/setup-ruby@v1
34
+ uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
35
35
  with:
36
36
  bundler-cache: true
37
37
  # This is just to ensure the default config is valid. The target is intentionally set
@@ -12,12 +12,12 @@ jobs:
12
12
  steps:
13
13
  - name: Dependabot metadata
14
14
  id: metadata
15
- uses: dependabot/fetch-metadata@v2
15
+ uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
16
16
  with:
17
17
  github-token: "${{ secrets.GITHUB_TOKEN }}"
18
18
  - name: Enable auto-merge for Dependabot PRs
19
19
  if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
20
- uses: actions/github-script@v7
20
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
21
21
  with:
22
22
  github-token: "${{ secrets.GITHUB_TOKEN }}"
23
23
  script: |
@@ -12,7 +12,7 @@ jobs:
12
12
  stale:
13
13
  runs-on: ubuntu-latest
14
14
  steps:
15
- - uses: actions/stale@v9
15
+ - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
16
16
  with:
17
17
  stale-pr-message: >
18
18
  This PR has been automatically marked as stale because it has not had
data/.rubocop.yml CHANGED
@@ -3,8 +3,8 @@
3
3
  inherit_gem:
4
4
  rubocop-shopify: rubocop.yml
5
5
 
6
- require:
7
- - rubocop/cop/internal_affairs
6
+ plugins:
7
+ - rubocop-internal_affairs
8
8
 
9
9
  AllCops:
10
10
  Exclude:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.1
1
+ 3.4.3
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,29 @@
1
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/rubocop-sorbet.
2
+
3
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
4
+
5
+ ## Creating a new cop
6
+
7
+ To contribute a new cop, please use the supplied generator like this:
8
+
9
+ ```sh
10
+ bundle exec rake "new_cop[Sorbet/NewCopName]"
11
+ ```
12
+
13
+ which will create a skeleton cop, a skeleton spec, an entry in the default config file and will require the new cop so that it is properly exported from the gem.
14
+
15
+ Don't forget to update the documentation with:
16
+
17
+ ```sh
18
+ bundle exec rake generate_cops_documentation
19
+ ```
20
+
21
+ ## Releasing a new version
22
+
23
+ Update the version in the `VERSION` file.
24
+
25
+ Then run the `rake prepare_release` task.
26
+
27
+ This will update the version in the `lib/rubocop/sorbet/version.rb` file, the `config/default.yml` file, and the `Gemfile.lock` file.
28
+
29
+ It will also commit the changes, tag the release, and push the changes to the remote repository.
data/Gemfile CHANGED
@@ -7,6 +7,8 @@ gemspec
7
7
 
8
8
  gem "debug"
9
9
  gem "rake", ">= 12.3.3"
10
- gem "rspec", "~> 3.13"
10
+ gem "minitest"
11
+ gem "rubocop-minitest", ">= 0.38.1"
12
+ gem "mocha"
11
13
  gem "rubocop-shopify", require: false
12
14
  gem "yard", "~> 0.9"
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-sorbet (0.10.0)
4
+ rubocop-sorbet (0.10.1)
5
+ lint_roller
5
6
  rubocop (>= 1)
6
7
 
7
8
  GEM
@@ -12,16 +13,18 @@ GEM
12
13
  debug (1.10.0)
13
14
  irb (~> 1.10)
14
15
  reline (>= 0.3.8)
15
- diff-lcs (1.5.1)
16
16
  io-console (0.8.0)
17
17
  irb (1.14.3)
18
18
  rdoc (>= 4.0.0)
19
19
  reline (>= 0.4.2)
20
- json (2.10.2)
21
- language_server-protocol (3.17.0.4)
20
+ json (2.12.2)
21
+ language_server-protocol (3.17.0.5)
22
22
  lint_roller (1.1.0)
23
- parallel (1.26.3)
24
- parser (3.3.7.4)
23
+ minitest (5.25.5)
24
+ mocha (2.7.1)
25
+ ruby2_keywords (>= 0.0.5)
26
+ parallel (1.27.0)
27
+ parser (3.3.8.0)
25
28
  ast (~> 2.4.1)
26
29
  racc
27
30
  prism (1.4.0)
@@ -30,26 +33,13 @@ GEM
30
33
  stringio
31
34
  racc (1.8.1)
32
35
  rainbow (3.1.1)
33
- rake (13.2.1)
36
+ rake (13.3.0)
34
37
  rdoc (6.10.0)
35
38
  psych (>= 4.0.0)
36
39
  regexp_parser (2.10.0)
37
40
  reline (0.6.0)
38
41
  io-console (~> 0.5)
39
- rspec (3.13.0)
40
- rspec-core (~> 3.13.0)
41
- rspec-expectations (~> 3.13.0)
42
- rspec-mocks (~> 3.13.0)
43
- rspec-core (3.13.0)
44
- rspec-support (~> 3.13.0)
45
- rspec-expectations (3.13.0)
46
- diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.13.0)
48
- rspec-mocks (3.13.0)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.13.0)
51
- rspec-support (3.13.1)
52
- rubocop (1.75.1)
42
+ rubocop (1.75.8)
53
43
  json (~> 2.3)
54
44
  language_server-protocol (~> 3.17.0.2)
55
45
  lint_roller (~> 1.1.0)
@@ -57,15 +47,20 @@ GEM
57
47
  parser (>= 3.3.0.2)
58
48
  rainbow (>= 2.2.2, < 4.0)
59
49
  regexp_parser (>= 2.9.3, < 3.0)
60
- rubocop-ast (>= 1.43.0, < 2.0)
50
+ rubocop-ast (>= 1.44.0, < 2.0)
61
51
  ruby-progressbar (~> 1.7)
62
52
  unicode-display_width (>= 2.4.0, < 4.0)
63
- rubocop-ast (1.43.0)
53
+ rubocop-ast (1.44.1)
64
54
  parser (>= 3.3.7.2)
65
55
  prism (~> 1.4)
66
- rubocop-shopify (2.15.1)
67
- rubocop (~> 1.51)
56
+ rubocop-minitest (0.38.1)
57
+ lint_roller (~> 1.1)
58
+ rubocop (>= 1.75.0, < 2.0)
59
+ rubocop-ast (>= 1.38.0, < 2.0)
60
+ rubocop-shopify (2.17.0)
61
+ rubocop (~> 1.62)
68
62
  ruby-progressbar (1.13.0)
63
+ ruby2_keywords (0.0.5)
69
64
  stringio (3.1.2)
70
65
  unicode-display_width (3.1.4)
71
66
  unicode-emoji (~> 4.0, >= 4.0.4)
@@ -77,8 +72,10 @@ PLATFORMS
77
72
 
78
73
  DEPENDENCIES
79
74
  debug
75
+ minitest
76
+ mocha
80
77
  rake (>= 12.3.3)
81
- rspec (~> 3.13)
78
+ rubocop-minitest (>= 0.38.1)
82
79
  rubocop-shopify
83
80
  rubocop-sorbet!
84
81
  yard (~> 0.9)
data/README.md CHANGED
@@ -95,25 +95,11 @@ You can read about each cop supplied by RuboCop Sorbet in [the manual](manual/co
95
95
  Sorbet cops support the following versions:
96
96
 
97
97
  - Sorbet >= 0.5
98
- - Ruby >= 2.5
98
+ - Ruby >= 3.1
99
99
 
100
100
  ## Contributing
101
101
 
102
- Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/rubocop-sorbet. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
103
-
104
- To contribute a new cop, please use the supplied generator like this:
105
-
106
- ```sh
107
- bundle exec rake "new_cop[Sorbet/NewCopName]"
108
- ```
109
-
110
- which will create a skeleton cop, a skeleton spec, an entry in the default config file and will require the new cop so that it is properly exported from the gem.
111
-
112
- Don't forget to update the documentation with:
113
-
114
- ```sh
115
- bundle exec rake generate_cops_documentation
116
- ```
102
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.
117
103
 
118
104
  ## License
119
105
 
data/Rakefile CHANGED
@@ -5,13 +5,15 @@ require("bundler/gem_tasks")
5
5
  Dir["tasks/**/*.rake"].each { |t| load t }
6
6
 
7
7
  require "rubocop/rake_task"
8
- require "rspec/core/rake_task"
8
+ require "rubocop/cop/minitest_generator"
9
9
 
10
- RSpec::Core::RakeTask.new(:spec) do |spec|
11
- spec.pattern = FileList["spec/**/*_spec.rb"]
10
+ require "minitest/test_task"
11
+
12
+ Minitest::TestTask.create(:test) do |test|
13
+ test.test_globs = FileList["test/**/*_test.rb"]
12
14
  end
13
15
 
14
- task(default: [:documentation_syntax_check, :generate_cops_documentation, :spec])
16
+ task(default: [:documentation_syntax_check, :generate_cops_documentation, :test])
15
17
 
16
18
  desc("Generate a new cop with a template")
17
19
  task :new_cop, [:cop] do |_task, args|
@@ -25,7 +27,7 @@ task :new_cop, [:cop] do |_task, args|
25
27
  generator = RuboCop::Cop::Generator.new(cop_name)
26
28
 
27
29
  generator.write_source
28
- generator.write_spec
30
+ generator.write_test
29
31
  generator.inject_require(root_file_path: "lib/rubocop/cop/sorbet_cops.rb")
30
32
  generator.inject_config(config_file_path: "config/default.yml")
31
33
 
@@ -34,3 +36,39 @@ task :new_cop, [:cop] do |_task, args|
34
36
  .sub(/$\s+4\. Run.*changelog.*for your new cop\.$/m, "")
35
37
  puts todo_without_changelog_instruction
36
38
  end
39
+
40
+ module Releaser
41
+ extend Rake::DSL
42
+ extend self
43
+
44
+ desc "Prepare a release. The version is read from the VERSION file."
45
+ task :prepare_release do
46
+ version = File.read("VERSION").strip
47
+ puts "Preparing release for version #{version}"
48
+
49
+ update_file("lib/rubocop/sorbet/version.rb") do |version_file|
50
+ version_file.sub(/VERSION = ".*"/, "VERSION = \"#{version}\"")
51
+ end
52
+
53
+ update_file("config/default.yml") do |default|
54
+ default.gsub(/['"]?<<\s*next\s*>>['"]?/i, "'#{version}'")
55
+ end
56
+
57
+ sh "bundle install"
58
+ sh "bundle exec rake generate_cops_documentation"
59
+
60
+ sh "git add lib/rubocop/sorbet/version.rb config/default.yml Gemfile.lock VERSION manual"
61
+
62
+ puts "git commit -m 'Release #{version}'"
63
+ puts "git push origin main"
64
+ puts "git tag -a v#{version} -m 'Release #{version}'"
65
+ puts "git push origin v#{version}"
66
+ end
67
+
68
+ private
69
+
70
+ def update_file(path)
71
+ content = File.read(path)
72
+ File.write(path, yield(content))
73
+ end
74
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.10.1
data/bin/{rspec → rake} RENAMED
@@ -4,20 +4,16 @@
4
4
  #
5
5
  # This file was generated by Bundler.
6
6
  #
7
- # The application 'rspec' is installed as part of a gem, and
7
+ # The application 'rake' is installed as part of a gem, and
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
13
- "../../Gemfile",
14
- Pathname.new(__FILE__).realpath,
15
- )
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
16
12
 
17
- bundle_binstub = File.expand_path("../bundle", __FILE__)
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
18
14
 
19
15
  if File.file?(bundle_binstub)
20
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
21
17
  load(bundle_binstub)
22
18
  else
23
19
  abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
@@ -28,4 +24,4 @@ end
28
24
  require "rubygems"
29
25
  require "bundler/setup"
30
26
 
31
- load(Gem.bin_path("rspec-core", "rspec"))
27
+ load Gem.bin_path("rake", "rake")
data/config/default.yml CHANGED
@@ -1,11 +1,3 @@
1
- Sorbet/Refinement:
2
- Description: >-
3
- Checks for the use of Ruby Refinements library. Refinements add
4
- complexity and incur a performance penalty that can be significant
5
- for large code bases. They are also not supported by Sorbet.
6
- Enabled: pending
7
- VersionAdded: '<<next>>'
8
-
9
1
  inherit_mode:
10
2
  merge:
11
3
  - Exclude
@@ -22,6 +14,33 @@ Sorbet/BindingConstantWithoutTypeAlias:
22
14
  Enabled: true
23
15
  VersionAdded: 0.2.0
24
16
 
17
+ Sorbet/BlockMethodDefinition:
18
+ Description: >-
19
+ Disallows defining methods inside blocks without using `define_method`,
20
+ unless the block is a named class definition. This is to avoid running
21
+ into https://github.com/sorbet/sorbet/issues/3609.
22
+ Enabled: pending
23
+ Safe: true
24
+ SafeAutoCorrect: false
25
+ VersionAdded: '0.10.1'
26
+
27
+ Sorbet/BuggyObsoleteStrictMemoization:
28
+ Description: >-
29
+ Checks for the a mistaken variant of the "obsolete memoization pattern" that used to be required
30
+ for older Sorbet versions in `#typed: strict` files. The mistaken variant would overwrite the ivar with `nil`
31
+ on every call, causing the memoized value to be discarded and recomputed on every call.
32
+
33
+ This cop will correct it to read from the ivar instead of `nil`, which will memoize it correctly.
34
+
35
+ The result of this correction will be the "obsolete memoization pattern", which can further be corrected by
36
+ the `Sorbet/ObsoleteStrictMemoization` cop.
37
+
38
+ See `Sorbet/ObsoleteStrictMemoization` for more details.
39
+ Enabled: true
40
+ VersionAdded: '0.7.3'
41
+ Safe: true
42
+ SafeAutoCorrect: false
43
+
25
44
  Sorbet/CallbackConditionalsBinding:
26
45
  Description: 'Ensures callback conditionals are bound to the right type.'
27
46
  Enabled: false
@@ -33,11 +52,6 @@ Sorbet/CheckedTrueInSignature:
33
52
  Enabled: true
34
53
  VersionAdded: 0.2.0
35
54
 
36
- Sorbet/EmptyLineAfterSig:
37
- Description: 'Ensures that there are no blank lines after signatures'
38
- Enabled: true
39
- VersionAdded: 0.7.0
40
-
41
55
  Sorbet/ConstantsFromStrings:
42
56
  Description: >-
43
57
  Forbids constant access through meta-programming.
@@ -47,22 +61,28 @@ Sorbet/ConstantsFromStrings:
47
61
  Enabled: true
48
62
  VersionAdded: 0.2.0
49
63
 
64
+ Sorbet/EmptyLineAfterSig:
65
+ Description: 'Ensures that there are no blank lines after signatures'
66
+ Enabled: true
67
+ VersionAdded: 0.7.0
68
+ VersionChanged: '0.10.1'
69
+
50
70
  Sorbet/EnforceSigilOrder:
51
71
  Description: 'Ensures that Sorbet sigil comes first in a file.'
52
72
  Enabled: true
53
73
  VersionAdded: 0.3.4
54
74
 
55
- Sorbet/EnforceSingleSigil:
56
- Description: 'Ensures that there is only one Sorbet sigil in a file.'
57
- Enabled: true
58
- VersionAdded: 0.7.0
59
-
60
75
  Sorbet/EnforceSignatures:
61
76
  Description: 'Ensures all methods have a valid signature.'
62
77
  Enabled: false
63
78
  AllowRBS: false
64
79
  VersionAdded: 0.3.4
65
80
 
81
+ Sorbet/EnforceSingleSigil:
82
+ Description: 'Ensures that there is only one Sorbet sigil in a file.'
83
+ Enabled: true
84
+ VersionAdded: 0.7.0
85
+
66
86
  Sorbet/FalseSigil:
67
87
  Description: 'All files must be at least at strictness `false`.'
68
88
  Enabled: true
@@ -75,6 +95,11 @@ Sorbet/FalseSigil:
75
95
  - db/**/*.rb
76
96
  - script/**/*
77
97
 
98
+ Sorbet/ForbidComparableTEnum:
99
+ Description: 'Disallows including the `Comparable` module in a `T::Enum`.'
100
+ Enabled: true
101
+ VersionAdded: 0.8.2
102
+
78
103
  Sorbet/ForbidExtendTSigHelpersInShims:
79
104
  Description: 'Forbid the use of `extend T::Sig` and `extend T::Helpers` in RBI shims'
80
105
  Enabled: true
@@ -82,6 +107,18 @@ Sorbet/ForbidExtendTSigHelpersInShims:
82
107
  Include:
83
108
  - "**/*.rbi"
84
109
 
110
+ Sorbet/ForbidIncludeConstLiteral:
111
+ Description: 'Forbids include of non-literal constants.'
112
+ Enabled: false
113
+ VersionAdded: 0.2.0
114
+ VersionChanged: 0.5.0
115
+
116
+ Sorbet/ForbidMixesInClassMethods:
117
+ Description: >-
118
+ Disallows the usage of `mixes_in_class_methods` in favor of `extend ActiveSupport::Concern`.
119
+ Enabled: false
120
+ VersionAdded: '0.10.1'
121
+
85
122
  Sorbet/ForbidRBIOutsideOfAllowedPaths:
86
123
  Description: 'Forbids RBI files outside of the allowed paths'
87
124
  Enabled: true
@@ -92,31 +129,20 @@ Sorbet/ForbidRBIOutsideOfAllowedPaths:
92
129
  Include:
93
130
  - "**/*.rbi"
94
131
 
95
- Sorbet/ForbidIncludeConstLiteral:
96
- Description: 'Forbids include of non-literal constants.'
97
- Enabled: false
98
- VersionAdded: 0.2.0
99
- VersionChanged: 0.5.0
100
-
101
- Sorbet/ForbidTypeAliasedShapes:
102
- Description: 'Forbids defining type aliases that contain shapes'
103
- Enabled: false
104
- VersionAdded: 0.7.6
105
-
106
132
  Sorbet/ForbidSig:
107
133
  Description: 'Forbid usage of sig'
108
134
  Enabled: false
109
- VersionAdded: <<next>>
135
+ VersionAdded: 0.9.0
110
136
 
111
137
  Sorbet/ForbidSigWithRuntime:
112
138
  Description: 'Forbid usage of T::Sig.sig'
113
139
  Enabled: false
114
- VersionAdded: <<next>>
140
+ VersionAdded: 0.9.0
115
141
 
116
142
  Sorbet/ForbidSigWithoutRuntime:
117
143
  Description: 'Forbid usage of T::Sig::WithoutRuntime.sig'
118
144
  Enabled: false
119
- VersionAdded: <<next>>
145
+ VersionAdded: 0.9.0
120
146
 
121
147
  Sorbet/ForbidSuperclassConstLiteral:
122
148
  Description: 'Forbid superclasses which are non-literal constants.'
@@ -129,15 +155,13 @@ Sorbet/ForbidSuperclassConstLiteral:
129
155
  Sorbet/ForbidTEnum:
130
156
  Description: 'Forbid usage of T::Enum.'
131
157
  Enabled: false
132
- VersionAdded: <<next>>
133
- VersionChanged: <<next>>
158
+ VersionAdded: 0.8.9
134
159
  Safe: false
135
160
 
136
161
  Sorbet/ForbidTStruct:
137
162
  Description: 'Forbid usage of T::Struct.'
138
163
  Enabled: false
139
- VersionAdded: <<next>>
140
- VersionChanged: <<next>>
164
+ VersionAdded: 0.7.4
141
165
  Safe: false
142
166
 
143
167
  Sorbet/ForbidTUnsafe:
@@ -152,6 +176,11 @@ Sorbet/ForbidTUntyped:
152
176
  VersionAdded: 0.6.9
153
177
  VersionChanged: 0.7.0
154
178
 
179
+ Sorbet/ForbidTypeAliasedShapes:
180
+ Description: 'Forbids defining type aliases that contain shapes'
181
+ Enabled: false
182
+ VersionAdded: 0.7.6
183
+
155
184
  Sorbet/ForbidUntypedStructProps:
156
185
  Description: >-
157
186
  Disallows use of `T.untyped` or `T.nilable(T.untyped)` as a
@@ -190,7 +219,7 @@ Sorbet/ImplicitConversionMethod:
190
219
  This cop disallows declaring implicit conversion methods, as sorbet does
191
220
  not support implicit conversion.
192
221
  Enabled: false
193
- VersionAdded: '<<next>>'
222
+ VersionAdded: 0.7.1
194
223
 
195
224
  Sorbet/KeywordArgumentOrdering:
196
225
  Description: >-
@@ -202,6 +231,11 @@ Sorbet/KeywordArgumentOrdering:
202
231
  Enabled: true
203
232
  VersionAdded: 0.2.0
204
233
 
234
+ Sorbet/MultipleTEnumValues:
235
+ Description: 'Ensures that all `T::Enum`s have multiple values.'
236
+ Enabled: true
237
+ VersionAdded: 0.8.2
238
+
205
239
  Sorbet/ObsoleteStrictMemoization:
206
240
  Description: >-
207
241
  This cop checks for the obsolete pattern for initializing instance variables that was required for older Sorbet
@@ -214,23 +248,6 @@ Sorbet/ObsoleteStrictMemoization:
214
248
  Safe: true
215
249
  SafeAutoCorrect: true
216
250
 
217
- Sorbet/BuggyObsoleteStrictMemoization:
218
- Description: >-
219
- Checks for the a mistaken variant of the "obsolete memoization pattern" that used to be required
220
- for older Sorbet versions in `#typed: strict` files. The mistaken variant would overwrite the ivar with `nil`
221
- on every call, causing the memoized value to be discarded and recomputed on every call.
222
-
223
- This cop will correct it to read from the ivar instead of `nil`, which will memoize it correctly.
224
-
225
- The result of this correction will be the "obsolete memoization pattern", which can further be corrected by
226
- the `Sorbet/ObsoleteStrictMemoization` cop.
227
-
228
- See `Sorbet/ObsoleteStrictMemoization` for more details.
229
- Enabled: true
230
- VersionAdded: '0.7.3'
231
- Safe: true
232
- SafeAutoCorrect: false
233
-
234
251
  Sorbet/RedundantExtendTSig:
235
252
  Description: >-
236
253
  Forbid the usage of redundant `extend T::Sig`.
@@ -241,6 +258,23 @@ Sorbet/RedundantExtendTSig:
241
258
  Safe: false
242
259
  VersionAdded: 0.7.0
243
260
 
261
+ Sorbet/Refinement:
262
+ Description: >-
263
+ Checks for the use of Ruby Refinements library. Refinements add
264
+ complexity and incur a performance penalty that can be significant
265
+ for large code bases. They are also not supported by Sorbet.
266
+ Enabled: pending
267
+ VersionAdded: 0.8.6
268
+
269
+ Sorbet/SelectByIsA:
270
+ Description: >-
271
+ Suggests using `grep` over `select` when using it only for type narrowing.
272
+ This is because Sorbet can properly infer types when using `grep` but not with `select`.
273
+ Enabled: true
274
+ VersionAdded: '0.10.1'
275
+ Safe: true
276
+ SafeAutoCorrect: true
277
+
244
278
  Sorbet/SignatureBuildOrder:
245
279
  Description: >-
246
280
  Enforces the order of parts in a signature.
@@ -339,13 +373,3 @@ Sorbet/VoidCheckedTests:
339
373
  Description: 'Forbid `.void.checked(:tests)`'
340
374
  Enabled: true
341
375
  VersionAdded: 0.7.7
342
-
343
- Sorbet/MultipleTEnumValues:
344
- Description: 'Ensures that all `T::Enum`s have multiple values.'
345
- Enabled: true
346
- VersionAdded: 0.8.2
347
-
348
- Sorbet/ForbidComparableTEnum:
349
- Description: 'Disallows including the `Comparable` module in a `T::Enum`.'
350
- Enabled: true
351
- VersionAdded: 0.8.2
data/dev.yml CHANGED
@@ -7,5 +7,5 @@ up:
7
7
  - "bundler"
8
8
 
9
9
  commands:
10
- test: "bin/rspec"
10
+ test: "bin/rake test"
11
11
  style: "bin/rubocop"