hooksman 3.1.2 copy "hooksman: ^3.1.2" to clipboard
hooksman: ^3.1.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 PreCommitHook(
    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'],
      ),
    ],
  );
}
4
likes
140
points
219
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

async, change_case, collection, equatable, file, glob, mason_logger, meta, scoped_deps, uuid

More

Packages that depend on hooksman