简体   繁体   中英

pre-commit: Differentiating between files modified and actual failure

It seems pre-commit exits with code 0 if everything is fine, and exit code 1 if any checks Fail - regardless of reason.

Is there a way (programmatically) to differentiate between failures that resulted in files being modified (thereby fixing the problem) vs a problem that requires a user (like "E501 line too long")?

short answer: no

slightly longer answer: no but also it also would be impossible to know if all linting would pass after formatting plus tools can both modify files and at the same time produce "errors"


disclaimer: I wrote pre-commit

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM