hooksman 1.0.2 copy "hooksman: ^1.0.2" to clipboard
hooksman: ^1.0.2 copied to clipboard

Create git hooks and tasks using Dart scripts and Shell commands

example/main.dart

// pre_commit.dart
import 'package:hooksman/hooksman.dart';

Hook main() {
  return Hook(
    tasks: [
      ReRegisterHooks(),
      ShellTask(
        name: 'Lint & Format',
        include: [Glob('**.dart')],
        exclude: [
          Glob('**.g.dart'),
        ],
        commands: (filePaths) => [
          'dart analyze --fatal-infos ${filePaths.join(' ')}',
          'dart format ${filePaths.join(' ')}',
        ],
      ),
      ShellTask(
        name: 'Build Runner',
        include: [Glob('lib/models/**.dart')],
        exclude: [Glob('**.g.dart')],
        commands: (filePaths) => [
          'sip run build_runner build',
        ],
      ),
      ShellTask(
        name: 'Tests',
        include: [Glob('**.dart')],
        exclude: [Glob('hooks/**')],
        commands: (filePaths) => [
          'sip test --concurrent --bail',
        ],
      ),
    ],
  );
}
0
likes
160
points
24
downloads

Publisher

verified publishermrgnhnt.com

Weekly Downloads

Create git hooks and tasks using Dart scripts and Shell commands

Repository (GitHub)
View/report issues

Topics

#git #hooks #git-hooks #shell #script

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

args, async, change_case, collection, equatable, file, glob, mason_logger, meta, path, uuid

More

Packages that depend on hooksman