fluttercommunity / fluttercommunity/import_sorter

Pre-commit hook doesn't work with custom dart/flutter executable locations

Open
#41 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
183
Forks
42
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.