hanzo 1.0.2

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).


    // 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
--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

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:

  hanzo: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter 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';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5

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. (-4.41 points)

Analysis of lib/hanzo.dart reported 9 hints, including:

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 20 col 20: Unnecessary new keyword.

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

line 41 col 20: Unnecessary new keyword.

Fix bin/hanzo.g.dart. (-1.49 points)

Analysis of bin/hanzo.g.dart reported 3 hints:

line 13 col 33: Unnecessary new keyword.

line 17 col 5: Unnecessary new keyword.

line 81 col 52: Unnecessary new keyword.

Maintenance suggestions

Package is getting outdated. (-44.38 points)

The package was last published 75 weeks ago.

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.48 <3.0.0
args ^1.5.0 1.5.2
build_cli ^1.0.0 1.3.6
build_cli_annotations ^1.0.0 1.1.0
io ^0.3.3 0.3.3
Transitive dependencies
_fe_analyzer_shared 1.0.3
analyzer 0.39.4
async 2.4.0
build 1.2.2
build_config 0.4.2
charcode 1.1.3
checked_yaml 1.0.2
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
json_annotation 3.0.1
logging 0.11.4
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0 2.0.0
path 1.6.4
pedantic 1.9.0
pub_semver 1.4.3
pubspec_parse 0.1.5
source_gen 0.9.4+7
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
yaml 2.2.0
Dev dependencies
build_runner ^0.10.0
grinder ^0.8.3
test ^1.3.0