-
Notifications
You must be signed in to change notification settings - Fork 5
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
style: replace yamllint with prettier #305
base: main
Are you sure you want to change the base?
Conversation
Lints and formats YAML, JSON, JSON5, Markdown and CSS files with prettier. Cannot do TOML right now due to: prettier/prettier#15141 Fixes #273 CRAFT-3626
Automatically format files with new formatters
41f0ae4
to
578b0cd
Compare
@lengau I'd need some extra time to test this against Markdown and CSS (if that's desired). Does this need merging ASAP? |
@medubelko not really, but all that happened here to the CSS file was it got auto-formatted. Prettier shouldn't make any changes that don't get parsed the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also:
- remove yamllint from the
tox.ini
file? - replace the call to yamllint in the precommit hook by a call to prettier?
- remove the
.yamllint.yaml
file?
@@ -13,6 +13,9 @@ else | |||
APT := apt-get | |||
endif | |||
|
|||
PRETTIER=npm exec --package=prettier -- prettier | |||
PRETTIER_FILES=**.yaml **.yml **.json **.json5 **.css **.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a bit sad that prettier does not support reStructuredText (nor any of the community plugins). That would be great to have one because we tend to mess our .rst
files (currently the README.rst
looks wrong on GitHub).
Did you look into it? (I took a very quick look and did not find anything serious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did for unrelated reasons. There's no prettier plugin for it, but docstrfmt looks promising. For the particular use case of our README though, it gives:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've raised this as a question for the new year: #308
Thanks to @bepri for finding this
Lints and formats YAML, JSON, JSON5, Markdown and CSS files with prettier.
Cannot do TOML right now due to:
prettier/prettier#15141
Fixes #273
CRAFT-3626
tox
?