-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Lint request: drop_flags #7025
Copy link
Copy link
Open
Labels
A-lintArea: New lintsArea: New lintsE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onL-restrictionLint: Belongs in the restriction lint groupLint: Belongs in the restriction lint group
Description
Activity
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onL-restrictionLint: Belongs in the restriction lint groupLint: Belongs in the restriction lint group
What it does
Detects usage of drop flags.
Categories (optional)
Drop flags come with a hidden runtime cost, and can sometimes be an oversight.
Drawbacks
None.
Example
Could be written as:
This is a restriction lint because there are some cases where drop flags seemingly make sense, such as a lazy or optional lock:
altho we'd argue this code is confusing and an explicit drop flag would be better: