Python: Use Prettier to format TOML and more files#7248
Conversation
Fokko
left a comment
There was a problem hiding this comment.
Thanks @deepyaman, this looks great! I have one comment about the note, would it be possible to have to linker accept that? Otherwise, it breaks the note.
| !!! note "Requirements" | ||
| This requires [PyArrow to be installed](index.md) | ||
|
|
||
| This requires [PyArrow to be installed](index.md) |
There was a problem hiding this comment.
This breaks the note unfortunately.
There was a problem hiding this comment.
Hmm... I haven't used mkdocs previously, but it seems like their admonition syntax isn't supported by Prettier (or the underlying parser). There are a number of existing issues (e.g. prettier/prettier#3362 and prettier/prettier#12985) highlighting this, and the recommendation seems to wrap them in <!-- prettier-ignore-start -->, <!-- prettier-ignore-end -->. I can do that if it's acceptable?
There was a problem hiding this comment.
I'm aware of the note syntax being a bit odd indeed, other linters are also having issues with that. I'm okay with the ignore comments 👍🏻
There was a problem hiding this comment.
@Fokko Sorry for the delay, but I think it looks good now!
| | Create Namespace | X | X | | ||
| | Drop Namespace | X | X | | ||
| | Set Namespace Properties | X | X | | ||
| | Operation | Java | Python | |
Fokko
left a comment
There was a problem hiding this comment.
@deepyaman Love it, thanks for picking this up!
* Python: Use Prettier to format TOML and more files * Python: Make Prettier skip the mkdocs admonoitions
* Python: Use Prettier to format TOML and more files * Python: Make Prettier skip the mkdocs admonoitions



Came across #6745 (comment) while looking into something else, and figured I could do it quickly. :)
Prettier is a well-established auto-formatter for many types of files. I've personally used it on a lot of projects int he past. The TOML integration is community-built (but linked to from the official Prettier website and docs) and no longer maintained, but still seems to function fine (including in testing on the case from the aforementioned comment). On the whole, it did seem to help standardize formatting of the
pyproject.tomlfile.