Adopted from https://github.com/adamchainz/pre-commit-dprint. Thanks to @adamchainz for their work!
Mirror of dprint for pre-commit.
Add to your pre-commit config:
- repo: https://github.com/adamchainz/pre-commit-dprint
rev: '' # Use the sha / tag you want to point at
hooks:
- id: dprint
Then add a dprint.json
(or .dprint.json
) configuration file in the root of your repository.
By default all text files are passed to dprint, which then only acts on files for which it has a relevant plugin configured.