hanzo 1.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 44

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]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
74
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, other

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

Health issues and suggestions

Document public APIs. (-1 points)

29 out of 29 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/hanzo.dart. (-2.48 points)

Analysis of lib/hanzo.dart reported 5 hints:

line 6 col 63: Use = to separate a named parameter from its default value.

line 11 col 3: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 37 col 27: Use = to separate a named parameter from its default value.

line 44 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 59 col 27: Use = to separate a named parameter from its default value.

Maintenance suggestions

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and hanzo.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

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.2.2
build_cli_annotations ^1.0.0 1.0.1
io ^0.3.3 0.3.3
Transitive dependencies
analyzer 0.35.1
async 2.0.8
build 1.1.1
build_config 0.3.1+4
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.3
front_end 0.1.11
glob 1.1.7
html 0.13.3+3
json_annotation 2.0.0
kernel 0.3.11
logging 0.11.3+2
meta 1.1.7
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.4
source_gen 0.9.4+1
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0
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