Skip to content

Conversation

Morriar
Copy link
Contributor

@Morriar Morriar commented Mar 6, 2025

So people can choose to allow/disallow the different shapes of sigs:

sig { void }
def foo; end

T::Sig.sig { void }
def foo; end

T::Sig::WithoutRuntime.sig { void }
def foo; end

Morriar added 3 commits March 6, 2025 15:46
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar added the feature Add a new feature label Mar 6, 2025
@Morriar Morriar self-assigned this Mar 6, 2025
@Morriar Morriar requested a review from a team as a code owner March 6, 2025 20:48
class ForbidSig < ::RuboCop::Cop::Base
include SignatureHelp

MSG = "Do not use `T::Sig`."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can help educate people about why this is, e.g.

Suggested change
MSG = "Do not use `T::Sig`."
MSG = "Prefer the RBS signature comment syntax over `T::Sig`."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't on purpose, same reason there is not autocorrect.

I wonder if we should leverage the Details config option for this? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I even removed the hint from ForbidSigWithoutRuntime message: a5ac3e4

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar merged commit 590a58c into main Mar 7, 2025
12 checks passed
@Morriar Morriar deleted the at-forbid-sig branch March 7, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants