-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cop that checks for valid sigil #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for indulging me!
Instead of searching twice, why not search the first block of comment tokens? something like: This way you wouldn't have to search twice to find the location of the token when you want to report the error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the rule for matching the comment is, but I think we can be a bit more flexible with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Adds a new cop
ValidSorbetSigil
that checks that every Ruby file contains a valid Sorbet sigil. Has autocorrect features that addstyped: false
to all files that do not have a sigil. I've tested this on core and it works as expected and causes no typecheck errors.I've talked to @clarkdave and has given me permission to adapt from this gist: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52.