-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to configure within pre-commit #2
Comments
Hey! You're correct that this plugin (or more accurately Black used by this plugin) is currently not configurable. It always runs using whatever defaults Black's API has. I'm currently not sure if we should change this or not. It may not be a great idea for There could also be use cases where reading the configuration for docs is not preferable. These are just my initial thougts, not exactly sure what to do here. |
well I think it would be nice to be able to specify the Black version which is used by this plugin (or write to readme how t do it) and ideally, load config the same way as Black does - loading config file if it exists otherwise use defaults... that it is kind of more predictable... at least you have the same Black formatting in your codebase as well as the markdown files... 🐰 |
how about using this one? https://github.com/asottile/blacken-docs |
Integrating
blacken-docs formats using Black's API exactly the same way as mdformat-black and also does not read Black's config for similar reasons. |
This you can do simply by installing the Black version that you want to use. To configure with pre-commit, use - repo: https://github.com/executablebooks/mdformat
rev: 0.7.8
hooks:
- id: mdformat
additional_dependencies:
- mdformat-black
- black==21.7b0 |
Hello,
I was testing this extension and it seems that it does not follow the Black configuration from
pyproject.toml
which isthe pre-commit configuration is:
see sample here: Lightning-AI/pytorch-lightning#8673 (comment)
The text was updated successfully, but these errors were encountered: