我正在使用flutter-format-pre-commit库来在提交之前自动格式化代码。
在文件 .pre-commit-config.yaml 中,我已经设置了用于测试功能挂钩的应用程序的开始文件。
- repo: https://github.com/Cretezy/flutter-format-pre-commit
rev: "master"
hooks:
- id: flutter-format
files: lib/src/app.dart # Only format source file
我故意缩进文件,然后提交,我得到一个错误-
Commit failed with error
0 files committed, 1 file failed to commit: test hook
Format Flutter Code......................................................Failed
hookid: flutter-format
Files were modified by this hook. Additional output:
Formatted lib/src/app.dart
find: ‘> bin [’: No such file or directory