4

I already have a pre-commit hook in my project, but I want to force all people in my project to use it. For that purpose, I want to write a flutter library for creating files in a flutter project directory(like a husky in js world)! All that I have searched are about widgets libraries and so on!

I know that in js libraries in package.json there is a script object with install property. In this property, anybody can write to run a script. Is there an opportunity to do the same thing in dart or flutter?

no_fate
  • 1,625
  • 14
  • 22

1 Answers1

5

You can apply Git hooks in Flutter projects using Lefthook. I've written about it here. However, a pre-commit hook can be bypassed with the --no-verify flag, so I'd suggest you to also integrate checks on a pipeline. I've written about this using GitHub Actions and GitLab CI in case you're using one of these services.

arthurdenner
  • 79
  • 1
  • 4