Skip to content

bbortt/owl

Repository files navigation

🦉 OWL

GIT hooks made easy.

+ Written in pure JS.
+ Configuration as code: Stored in readable JSON format.
+ MIT Licensed.

@bbortt/owl Blazing Fast License FOSSA Status

Table Of Contents

Installation

Once downloaded you need to initialize the hook and create a configuration. Add @bbortt/owl via npm or yarn and execute the installation command in order to set up the hooks:

owl install

For Future use

Add "prepare": "node projects/core/src install", to your scripts, so future users will have Owl automatically installed.

Initialization

You can create a compatible rc file by hand or via owl init (see the documentation). Add hooks using the owl add command (help for help), or by hand too. Example:

owl add pre-commit "npx pretty-quick --staged"

Take a look at configuration files or the CLI documentation for more information.

Configuration Files

In order to support multiple commands in the same hook this project reads configuration via cosmiconfig. Valid files are for example package.json , .owlrc.json or other compatible rc files.
This does make it possible to configure hooks without using the CLI too. An example .owlrc.json:

{
  "hooks": {
    "pre-commit": ["npx pretty-quick --staged"]
  }
}

Supported Hooks

  • pre-commit

More to come in #1.

CLI

The following commands are executable through the cli owl [COMMAND] args..:

install

Signature: owl install [dir=.owl].
Arguments:

  • --force install outside process directory (useful for multi module projects).

Installs the binary into .owl. Careful: Do not manually update the generated files. They will be overwritten by any subsequent calls of this command (for example in a postinstall script).

init

Signature: owl init.

Initializes a configuration file called .owlrc.json in the root directory. It does not contain any hooks.

add

Signature: owl add [TYPE] [COMMAND].

Adds a hook by type into any found configuration file. E.g. the .owlrc.json was completed using owl add pre-commit "ngx pretty-quick --staged".

Supported hooks are: [ applypatch-msg, commit-msg, fsmonitor-watchman, post-update, pre-applypatch, pre-commit, pre-merge-commit, pre-push, pre-rebase, pre-receive, prepare-commit-msg, update ] .

How Does It Work?

It really is no magic! To be documented.

License

This project is licensed under the terms of the MIT license.

About

GIT hooks made easy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •