[idea] Integrate with pre-commit
Nice work on this project! I've been looking for something like it for some time.
I'm wondering if the bot could be configured to run pre-commit. That way, it could do more than just format with black.
pre-commit + a GitHub bot would ensure that unformatted code never gets merged, and would take the burden off maintainers and contributors.
In an ideal world, unformatted code never gets committed because pre-commit prevents it. In a realistic world, contributors may forget to install the pre-commit hooks. The black_out bot would be the last resort, making the formatting commit for you.
@sloria pre-commit's hooks (I assume you're talking about pre-commit.com tool) don't always do changes, that's why I guess it's hard to use it for such a thing.
@webknjaz Yes, I was referring to pre-commit.com. I'm not sure what you mean--running pre-commit run --all-files will modify files in place.
Err.. not exactly. It will run hooks and those hooks may modify files if they are programmed to do so. Most of "hooks" there are linters, not autoformatters. Which conflicts with your statement a bit.
I don't see that as a blocker to implementing this feature, though.
It is common to run black through pre-commit, but not all projects use the black coding style. marshmallow, for example, currently uses pre-commit for formatting but does not use black: https://github.com/marshmallow-code/marshmallow/blob/dev/.pre-commit-config.yaml
Okay, I see where you're going with this. Makes sense.
Sorry for the late in responding. I've been out of open source for the past two months, and just saw this now.
So I've created this bot because I don't want to bother with pre-commit and all that, but I think there was another suggestion in the past for integrating additional services other than black. I will think more about this.
No worries!
Yeah, it makes sense why you'd want to use a bot for formatting. Integrating with pre-commit would generalize the tool a beyond black (and even beyond Python).