These hooks use the built in formatting and linting tools provided by the Dart SDK.
Add the following to your .pre-commit-config.yaml file:
repos:
- repo: https://github.com/jkerola/dart-precommit-hooks
rev: v1.0.0
hooks:
- id: dart-analyze
- id: dart-formatIncluding and excluding files is supported:
repos:
- repo: https://github.com/jkerola/dart-precommit-hooks
rev: v1.0.0
hooks:
- id: dart-analyze
files: lib/* # defaults to all .dart files
exclude: bin/* # nothing is excluded by default