* WIP Bump to 3.0.0-0 * fix lints * drop web_ui * opt pointer_converter.dart out of dart 3 * Revert "drop web_ui" This reverts commit b97a015d5cd0d7e0380a4231be4c31aad36671f1.
Git Hooks
The behavior of git commands can be customized through the use of "hooks".
These hooks are described in detail in git's
documentation.
git looks for an executables by name in the directory specified by
the core.hooksPath git config setting. The script setup.py here points
core.hooksPath at this directory. It runs during a gclient sync or a
gclient runhooks.
The hooks here are implemented in Dart by the program with
entrypoint bin/main.dart in this directory. The commands of the program
are the implementation of the different hooks, for example
bin/main.dart pre-push .... Since the Dart program itself isn't an executable,
these commands are invoked by small Python wrapper scripts. These wrapper
scripts have the names that git will look for.
pre-push
This hooks runs when pushing commits to a remote branch, for example to
create or update a pull request: git push origin my-local-branch.
The pre-push hook runs ci/lint.sh and ci/format.sh. ci/analyze.sh and
ci/licenses.sh are more expensive and are not run.
Adding new pre-push checks
Since the pre-push checks run on every git push, they should run quickly.
New checks can be added by modifying the run() method of the PrePushCommand
class in lib/src/pre_push_command.dart.
Creating a new hook
- Check the
gitdocumentation, and copypre-pushinto a script with the right name. - Make sure the script has the executable bit set
(
chmod +x <script>). - Add a new
Commandimplementation underlib/src. Give the newCommandthe same name as the new hook. - Add the new
Commandto theCommandRunnerinlib/githooks.dart. - Make sure the script from step (1) is passing the new command to the Dart program.