-
Notifications
You must be signed in to change notification settings - Fork 151
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
Apply code formatting to code examples in our docs #719
Comments
Hi I can help with this |
We could use Something I'm going to need some advice from @antonymilne or @maxschulz-COL on I think. |
I have already reported on that and there is a ticket and even a PR that aims to finish it. I didn't get around to doing it though. See adamchainz/blacken-docs#357 for reference |
I also looked into this and decided that After playing around a bit I found that the right pre-commit configuration looks something like this:
The problems were:
I'd suggest:
|
This is great, yes, I can do that. Will you make a branch for that pre-commit, or shall I? Happy to put this into the upcoming sprint to get it further advanced. |
You go for it 🙂 I suggest you start with this:
and play around with the And then afterwards add in this to see what difference it makes:
|
I've given it a try here: https://github.com/mckinsey/vizro/tree/docs/update-precommit but two of the args you included ( |
Ah yes, I think those arguments are only added when The changes are pretty far-reaching (one reason I didn't do this before as a quick PR) and I think will need some careful checking through, mainly to make sure that the built docs still look ok. e.g. I'm pretty sure that changes like What happens if you just run it with this without the
(and playing around with any other settings you might like there) |
Thanks! My branch has the change for just the I'll have another play with the mkdocs plugin since I couldn't get it working yesterday but maybe there's an extra space or something in my file. |
Isn't that the change caused by the following configuration though, which includes
|
Ignore me -- I was correct earlier when I said "maybe there's an extra space or something in my file." There was a missing 4 spaces 🤦♀️🤦♀️🤦♀️ |
Whoops, didn't mean to close. OK, here's a new branch with the output from
|
Thanks @stichbury! I've spent a while looking through your branch and playing round myself.
Please could you continue working on #873? And give me a shout if you need any help with it. I think this is probably worth proceeding with but I'm not wedded to it if it's seems like too much effort for little reward. btw remember you can run just one linter with |
Next step here: |
Currently our code examples are not formatted using
black
or linted in any way.ruff
orblack
)The text was updated successfully, but these errors were encountered: