Skip to content

Instantly share code, notes, and snippets.

@crizant
Last active November 16, 2020 02:08
Show Gist options
  • Save crizant/04d4fa9a592a894c2b184068aa6c4bde to your computer and use it in GitHub Desktop.
Save crizant/04d4fa9a592a894c2b184068aa6c4bde to your computer and use it in GitHub Desktop.
Lefthook config file for flutter projects
pre-commit:
piped: true
commands:
linter:
run: flutter analyze lib
sort-imports:
glob: "*.dart"
run: flutter pub run import_sorter:main {staged_files} && git add {staged_files}
pretty:
glob: "*.dart"
run: flutter format {staged_files} && git add {staged_files}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment