Skip to content

Commit

Permalink
Merge pull request #273 from stathis-alexander/ajs/fix-documentation-…
Browse files Browse the repository at this point in the history
…for-sigil-cops

fix documentation: sigil cops autocorrect using suggested level
  • Loading branch information
KaanOzkan authored Dec 20, 2024
2 parents 0b3d4ac + 32859e4 commit 76ac745
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rubocop/cop/sorbet/sigils/has_sigil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Sorbet
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
#
# If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
class HasSigil < ValidSigil
def require_sigil_on_all_files?
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/sorbet/sigils/valid_sigil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Sorbet
# * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
#
# If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
# If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
# Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
class ValidSigil < RuboCop::Cop::Base
extend AutoCorrector
Expand Down
2 changes: 2 additions & 0 deletions manual/cops_sorbet.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ Options:
* `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
* `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one

If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.

### Configurable attributes
Expand Down Expand Up @@ -983,6 +984,7 @@ Options:
* `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
### Configurable attributes
Expand Down

0 comments on commit 76ac745

Please sign in to comment.