hanzo 0.1.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

hanzo

A library to easily use git hooks from Dart

Install

To start using Hanzo, add it to your dev_dependencies and run pub get

To install hooks in your project, run:

$ pub run hanzo install
    

Now create a matching git hook dart file in ./tool directory (create if needed).

Example:

    // in ./tool/pre_commit.dart
    main(List<String> arguments) => 
        print("I'll run before a commit is made!");

    // in ./tool/commit_msg.dart
    main(List<String> arguments) => 
        print("I'll run after commit message is entered!");

Install options

Option/Flagabbreviationdescription
--precommit-samplenoneIf flag is passed it will create a sample pre commit Dart script. Defaults to false
--hook <hook-name>-kCreates a bash script for the hook passed, supports passing multiple hooks. Defaults to all scripts. Example: -k pre-commit -k commit-message

Remove

To remove all hooks in your project, run:

$ pub run hanzo remove

Or if you want to remove a specific hook:

$ pub run hanzo remove -k pre-commit -k commit-msg

Git Hooks

Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. Hanzo supports all git hooks (https://git-scm.com/docs/githooks)

Git hookDart script name
applypatch-msgapplypatch_msg.dart
commit-msgcommit_msg.dart
post-applypatchpost_applypatch.dart
post-checkoutpost_checkout.dart
post-commitpost_commit.dart
post-mergepost_merge.dart
post-receivepost_receive.dart
post-rewritepost_rewrite.dart
post-updatepost_update.dart
pre-applypatchpre_applypatch.dart
pre-auto-gcpre_auto_gc.dart
pre-commitpre_commit.dart
pre-pushpre_push.dart
pre-rebasepre_rebase.dart
pre-receivepre_receive.dart
prepare-commit-msgprepare_commit_msg.dart
push-to-checkoutpush_to_checkout.dart
updateupdate.dart

Accessing Git params

Git params will be passed as arguments to the main function of the Dart script.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.1

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  hanzo: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:hanzo/hanzo.dart';
  
Version Uploaded Documentation Archive
0.1.1 Jun 9, 2017 Go to the documentation of hanzo 0.1.1 Download hanzo 0.1.1 archive
0.1.0 Jun 9, 2017 Go to the documentation of hanzo 0.1.0 Download hanzo 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0