hanzo 1.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 41

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

$ pub global activate hanzo
$ hanzo -i pre_commit -s
Option/Flagabbreviationdescription
--add-sample-sIf flag is passed it will create a sample Dart script. Defaults to false
--install <hook_name>-iCreates a bash script for the hook passed. Defaults to pre_commit script. Example: -i pre_commit
--remove <hook_name>-rRemoves a bash script for the hook passed. Example: -r pre_commit. Defaults to all

Remove

To remove all hooks in your project, run:

$ hanzo -r

Or if you want to remove a specific hook:

$ hanzo -r pre_commit

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 an executable

1. Install it

You can install the package from the command line:


$ pub global activate hanzo

2. Use it

The package has the following executables:


$ hanzo

Use this package as a library

1. Depend on it

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


dependencies:
  hanzo: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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
1.0.2 Sep 3, 2018 Go to the documentation of hanzo 1.0.2 Download hanzo 1.0.2 archive
1.0.1 Sep 3, 2018 Go to the documentation of hanzo 1.0.1 Download hanzo 1.0.1 archive
1.0.0 Sep 3, 2018 Go to the documentation of hanzo 1.0.0 Download hanzo 1.0.0 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]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
41
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

Primary library: package:hanzo/hanzo.dart with components: io.

Health issues and suggestions

Document public APIs (-10 points)

29 out of 29 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use hanzo.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.48 <3.0.0
args ^1.5.0 1.5.1
build_cli ^1.0.0 1.1.0
build_cli_annotations ^1.0.0 1.0.1
io ^0.3.3 0.3.3
Transitive dependencies
analyzer 0.33.6 0.34.0
async 2.0.8
build 1.0.1
build_config 0.3.1+4
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.0 1.2.1
front_end 0.1.6+8 0.1.7
glob 1.1.7
html 0.13.3+3
json_annotation 2.0.0
kernel 0.3.6+8 0.3.7
logging 0.11.3+2
meta 1.1.6
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.2+3
source_gen 0.9.1+3
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner ^0.10.0
grinder ^0.8.3
test ^1.3.0