Some Dart hooks for pre-commit.
Can be used in Flutter projects.
Add this to your .pre-commit-config.yaml
- repo: https://github.com/pedrox-hs/flutter-pre-commit
rev: v1.1.0 # Use the ref you want to point at
hooks:
- id: dart-analyze
# - id: ...Analyze Dart code.
Dart source code format.
By default it just check for code format, to apply format use:
- id: dart-format
args: ["--output=write"]Apply automated fixes to Dart source code.
Alternative for dart-analyze with FVM.
Alternative for dart-format with FVM.
Alternative for dart-fix with FVM.