You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the pre-commit hook definition expects dart/flutter executables to be accessible in the search path.
However, it is a common practice to install several channels on the same machine and use different executable names for them. i.e. flutter-stable, dart-beta, etc.
It is possible to implement a hook that takes an executable name/path as an argument in the args parameter, see https://pre-commit.com/#passing-arguments-to-hooks. However, this requires transforming the definition in the script type and using an additional script that would construct the corresponding command to execute. The problem is we cannot just use bash for this as Windows users won't be able to use it.
The text was updated successfully, but these errors were encountered:
Another option is to use python hook type as a wrapper. From the pre-commit docs: Support: python hooks work without any system-level dependencies. It has been tested on linux, macOS, windows, and cygwin.https://pre-commit.com/#python
A simple python script will work on any platform and it is easy enough to parse arguments and invoke the proper command from it.
Well, according to the docs the entire repo must be installable as a python package. This will require some additional files in the repo root. Seems a bit inconvenient.
At the moment, the pre-commit hook definition expects
dart
/flutter
executables to be accessible in the search path.However, it is a common practice to install several channels on the same machine and use different executable names for them. i.e.
flutter-stable
,dart-beta
, etc.It is possible to implement a hook that takes an executable name/path as an argument in the
args
parameter, see https://pre-commit.com/#passing-arguments-to-hooks. However, this requires transforming the definition in thescript
type and using an additional script that would construct the corresponding command to execute. The problem is we cannot just usebash
for this as Windows users won't be able to use it.The text was updated successfully, but these errors were encountered: