manual/cops_sorbet.md in rubocop-sorbet-0.5.1 vs manual/cops_sorbet.md in rubocop-sorbet-0.6.0
- old
+ new
@@ -169,31 +169,65 @@
--- | --- | ---
SuggestedStrictness | `true` | Boolean
Include | `**/*.rb`, `**/*.rbi`, `**/*.rake`, `**/*.ru` | Array
Exclude | `bin/**/*`, `db/**/*.rb`, `script/**/*` | Array
+## Sorbet/ForbidExtendTSigHelpersInShims
+
+Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
+--- | --- | --- | --- | ---
+Enabled | Yes | Yes | 0.6.0 | -
+
+This cop ensures RBI shims do not include a call to extend T::Sig
+or to extend T::Helpers
+
+### Examples
+
+```ruby
+# bad
+module SomeModule
+ extend T::Sig
+ extend T::Helpers
+
+ sig { returns(String) }
+ def foo; end
+end
+
+# good
+module SomeModule
+ sig { returns(String) }
+ def foo; end
+end
+```
+
+### Configurable attributes
+
+Name | Default value | Configurable values
+--- | --- | ---
+Include | `**/*.rbi` | Array
+
## Sorbet/ForbidIncludeConstLiteral
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
-Disabled | Yes | No | 0.2.0 | 0.5.0
+Disabled | Yes | No | 0.2.0 | 0.5.0
No documentation
## Sorbet/ForbidSuperclassConstLiteral
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
-Disabled | Yes | No | 0.2.0 | 0.5.0
+Disabled | Yes | No | 0.2.0 | 0.5.0
No documentation
## Sorbet/ForbidUntypedStructProps
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
-Enabled | Yes | No | 0.3.8 | -
+Enabled | Yes | No | 0.4.0 | -
This cop disallows use of `T.untyped` or `T.nilable(T.untyped)`
as a prop type for `T::Struct`.
### Examples
@@ -256,10 +290,34 @@
# good
sig { params(b: String, a: Integer).void }
def foo(b:, a: 1); end
```
+## Sorbet/OneAncestorPerLine
+
+Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
+--- | --- | --- | --- | ---
+Enabled | Yes | Yes | - | -
+
+This cop ensures one ancestor per requires_ancestor line
+rather than chaining them as a comma-separated list.
+
+### Examples
+
+```ruby
+# bad
+module SomeModule
+ requires_ancestor Kernel, Minitest::Assertions
+end
+
+# good
+module SomeModule
+ requires_ancestor Kernel
+ requires_ancestor Minitest::Assertions
+end
+```
+
## Sorbet/ParametersOrderingInSignature
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
Enabled | Yes | No | 0.2.0 | -
@@ -295,9 +353,35 @@
Enabled | Yes | No | - | -
Abstract cop specific to Sorbet signatures
You can subclass it to use the `on_signature` trigger and the `signature?` node matcher.
+
+## Sorbet/SingleLineRbiClassModuleDefinitions
+
+Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
+--- | --- | --- | --- | ---
+Disabled | Yes | Yes | 0.6.0 | -
+
+This cop ensures empty class/module definitions in RBI files are
+done on a single line rather than being split across multiple lines.
+
+### Examples
+
+```ruby
+# bad
+module SomeModule
+end
+
+# good
+module SomeModule; end
+```
+
+### Configurable attributes
+
+Name | Default value | Configurable values
+--- | --- | ---
+Include | `**/*.rbi` | Array
## Sorbet/StrictSigil
Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---