Closed tony closed 2 years ago
Have you ever hooked prettier into your editor before for markdown files?
No before, I like table formating, for line wrapping not sure it is the best option if you want to edit text, otherwise, your editor should support similar logic or prettier should be integrated to pre-commit or check.
@tbicr
Would you like either of these?
setup pre-commit config (docs)
.pre-commit-config.yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "" # Use the sha or tag you want to point at
hooks:
- id: prettier
@tony , both looks good, thank you
@tbicr
.pre-commit-config.yaml
@tbicr As a next step, i'm not sure if you have yet, but you need to configure https://pre-commit.ci/ bot with the repository by logging in
@tony , can github action used instead https://github.com/pre-commit/action ?
@tbicr
Maybe but it looks like the author is moving away from the action
DEPRECATED this action is in maintenance-only mode and will not be accepting new features.
Please switch to using pre-commit.ci which is faster and has more features.
From the looks of it it's unsafe, re https://github.com/pre-commit/action/issues/148 and the bottom of the README
while you could technically configure this for a public repository (using a personal access token), I can't think of a way to do this safely without exposing a privileged token to pull requests -- if you have any ideas, please leave an issue!
It may be fine to use https://pre-commit.ci/, if not we can simply not use the tool for now
Have you ever hooked prettier into your editor before for markdown files? It automatically handles wrapping lines and tables.
https://github.com/tbicr/django-pg-zero-downtime-migrations/compare/master...tony:format-with-prettier
One command:
npx prettier --no-config --write README.md