Add Lint: camera_modification_in_fixed_update#417
Conversation
3124a84 to
98517bb
Compare
98517bb to
a71caa7
Compare
05736e1 to
512f57e
Compare
| if let ExprKind::Path(QPath::Resolved(_, path)) = system_expr.kind | ||
| && let Res::Def(_, def_id) = path.res |
There was a problem hiding this comment.
For a follow-up: This doesn't handle nested tuples. Meaning I don't think this will lint on:
app.add_systems(FixedUpdate, (unrelated, (also_unrelated, modifies_camera)));
// ^^^^^^^^^^^^^^^ Won't see thisThere was a problem hiding this comment.
Yep! I think I want to solve this first before merging, otherwise it could be confusing.
There was a problem hiding this comment.
It is a nursery lint, so you can list it in "Known Issues" if you want this shipped first.
There was a problem hiding this comment.
You may be able to use detuple() for this as well! But again, we can definitely push this back to a follow-up.
|
@BD103 Most of the feedback will apply to the other lint as well, since I mostly copied this code from here over ^^. Will update it! |
BD103
left a comment
There was a problem hiding this comment.
There's one quick logic issue and a documentation improvement, then I think I may just merge this and open a few follow-up issues. Thanks for getting this started!
| if let ExprKind::Path(QPath::Resolved(_, path)) = system_expr.kind | ||
| && let Res::Def(_, def_id) = path.res |
There was a problem hiding this comment.
You may be able to use detuple() for this as well! But again, we can definitely push this back to a follow-up.
Thanks for the fixes and feedback!😊 makes sense im a bit busy with exams so this is a good idea |
Hey no worries! I had to drop out a bit in the past few months, but I'm happy to take the reins now! (Best of luck studying too :) |
Adds a new lint called
camera_modification_in_fixed_updatethat checks if systems are added to the FixedUpdate schedule that mutably query entities with a Camera component.closes #105