- 
                Notifications
    You must be signed in to change notification settings 
- Fork 32
Add Lint: camera_modification_in_fixed_update #417
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
Conversation
3124a84    to
    98517bb      
    Compare
  
    98517bb    to
    a71caa7      
    Compare
  
    05736e1    to
    512f57e      
    Compare
  
            
          
                bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | if let ExprKind::Path(QPath::Resolved(_, path)) = system_expr.kind | ||
| && let Res::Def(_, def_id) = path.res | 
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! I think I want to solve this first before merging, otherwise it could be confusing.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be able to use detuple() for this as well! But again, we can definitely push this back to a follow-up.
        
          
                bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | @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! | 
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.
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!
        
          
                bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | if let ExprKind::Path(QPath::Resolved(_, path)) = system_expr.kind | ||
| && let Res::Def(_, def_id) = path.res | 
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.
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