Skip to content
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 ExactStrictness to Sorbet/ValidSigil cop #167

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Conversation

paracycle
Copy link
Member

This is useful for cases when a project wants to enforce a particular strictness for some part of its codebase, but nothing above or below that strictness for those files.

This is useful for cases when a project wants to enforce a particular
strictness for some part of its codebase, but nothing above or below that strictness for those files.
@paracycle paracycle requested a review from a team as a code owner August 2, 2023 18:28
Copy link
Contributor

@bitwise-aiden bitwise-aiden left a comment

Choose a reason for hiding this comment

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

Nice, I like this change 👍🏻

add_offense(
sigil,
location: sigil.pos,
message: "Sorbet sigil should be `#{exact_strictness}` got `#{strictness}`."
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there value of mentioning the configuration in these offenses?

Suggested change
message: "Sorbet sigil should be `#{exact_strictness}` got `#{strictness}`."
message: "Sorbet sigil should be `#{exact_strictness}` per your configuration, got `#{strictness}`."

Copy link
Member Author

Choose a reason for hiding this comment

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

We hadn't been doing it so far, so I'd shy away from doing it as part of this PR. But it might be a good idea for the future.

@paracycle paracycle merged commit f57aa94 into main Aug 2, 2023
@paracycle paracycle deleted the uk-exact-strictness branch August 2, 2023 18:46
@shopify-shipit shopify-shipit bot temporarily deployed to production August 3, 2023 19:59 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants