hooksman library

Classes

AllFiles
A pattern that matches all files. This class implements the Pattern interface and can be used to match any file path.
AnyHook
CommitMsgHook
A hook that runs for Git's commit-msg event.
DartTask
A task that runs Dart code on a set of files.
Glob
A glob for matching and listing files and directories.
Hook
The Hook class represents a Git hook configuration that defines a set of tasks to be executed during specific Git hook events. This class allows you to automate checks, validations, or any custom scripts to ensure code quality and consistency across your repository.
HookContext
Runtime context for a Git hook invocation (args + stdin).
HookTask
An abstract class representing a task to be executed as part of a Git hook.
ParallelTasks
A task that runs a series of sub-tasks in parallel on a set of files.
PreCommitHook
The Hook class represents a Git hook configuration that defines a set of tasks to be executed during specific Git hook events. This class allows you to automate checks, validations, or any custom scripts to ensure code quality and consistency across your repository.
PrePushHook
The Hook class represents a Git hook configuration that defines a set of tasks to be executed during specific Git hook events. This class allows you to automate checks, validations, or any custom scripts to ensure code quality and consistency across your repository.
ReRegisterHooks
The ReRegisterHooks task automates the process of re-registering Git hooks whenever any hook files are created, modified, or deleted. This ensures that changes to your hooks are applied: Dart sources are compiled into executables under .dart_tool/hooksman/, and thin shims are written to hooks/_ (Git's core.hooksPath).
SequentialTask
A task that runs a series of sub-tasks sequentially on a set of files.
SequentialTasks
A task that runs a series of sub-tasks sequentially on a set of files.
ShellTask
A task that runs a series of shell commands sequentially on a set of files.

Properties

hookContext → HookContext
no setter
hookContextProvider → ScopedRef<HookContext>
final

Functions

bindHookInvocation({required String name, required Hook hook, required List<String> args, String stdinContent = ''}) → ({Hook boundHook, HookContext context, String? messageFile, String? remoteName, String? remoteUrl})
Binds Git hook args into remote / message-file fields and a HookContext.
executeHook(String name, Hook hook, List<String> args) → Future<void>
normalizeHookName(String name) → String
shouldSkipHooks([Map<String, String>? environment]) → bool
Whether hooksman should no-op based on environment variables.

Typedefs

Run = FutureOr<int> Function(List<String>)
ShellCommands = List<String> Function(Iterable<String>)