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

New lints: More precise trait lints that take advantage of sealed trait analysis #973

Open
6 tasks
obi1kenobi opened this issue Oct 16, 2024 · 0 comments
Open
6 tasks
Labels
A-lint Area: new or existing lint E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.

Comments

@obi1kenobi
Copy link
Owner

At least three of our current lints were written before we could reliably determine if a trait was sealed or not. This means their queries are insufficiently precise, and can cause false-positives in cases where the trait is sealed.

In each case, we should update the existing lint to represent the "non-sealed" case, and add a new lint for the "sealed" case. The exact change required is slightly different in each case, so I'm linking to the corresponding descriptions in each case. Let's make each checkbox a separate PR:

  • trait_method_missing
    • update existing lint to represent non-sealed case only
    • add new sealed_trait_method_missing lint for the sealed case
  • trait_removed_associated_constant
    • update existing lint to represent non-sealed case only
    • add new sealed_trait_removed_associated_constant lint for the sealed case
  • trait_removed_associated_type
    • update existing lint to represent non-sealed case only
    • add new sealed_trait_removed_associated_type lint for the sealed case

In the sealed case, the breakage is associated with using the removed item. In the non-sealed case, the breakage is implementing the trait (if the removed item is hidden) and using the item (if not hidden).

Make sure to check out our contributing guide, and take a look at what prior lints' merged PRs looked like so you know what to expect. It's easier than you think!

@obi1kenobi obi1kenobi added A-lint Area: new or existing lint E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue. labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: new or existing lint E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.
Projects
None yet
Development

No branches or pull requests

1 participant