potiuk commented on pull request #17816:
URL: https://github.com/apache/airflow/pull/17816#issuecomment-908459967


   @kiwy42 - the way how pre-commit works in this case, it "fixes" things for 
you - but then it fails so that you can manually add those changed files and 
rerun commit again. Then it should work fine.  Pre-commit will work by default 
on changes that have been staged in git  (so you run git add on those 
changese). Most likely it modified your code but then you have not added those 
changes and re-run pre-commit again (which under the hood would "stash" the 
changes you've made and re-apply the fix again on the old version).
   
   In short your flow with pre-commit is :
   
   1) You run it
   2) In some cases it will apply fixes automatically in others it will tell 
you that there are things to fix
   3) You fix what you need to fix 
   4) You run `git add -p` (best) to apply the changes you've done and the 
changes done by pre-commit
   5) You run commit again and observe pre-commit is happy and  green 
   
   J.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to