pre-commit
hook for running Flutter unit tests
Add the following in your .pre-commit-config.yaml
:
- repo: https://github.com/dluksza/flutter-test-pre-commit
rev: "master"
hooks:
- id: flutter-test
By default flutter test
is run in repository root, this should work for most of the cases.
When your Flutter project is nested somewhere in git repository or you have multiple modules
add args
parameter to the hook configuration containing list of paths to the Flutter
projects, eg.:
hooks:
- id: flutter-test
args: [ module1, module2 ]
Charles Crete for creating flutter-format-pre-commit