Coder Social home page Coder Social logo

rusty-hook's Introduction

rusty-hook

Git hook utility for Rust codebases that lets you run any script for any git hook.

Functional, but still in Beta!

Version Badge Downloads Badge License Badge

Linux CI Badge Mac CI Badge Windows CI Badge

Test Results Badge Coverage Badge

Installing

The best way to install rusty-hook is to use cargo:

cargo install rusty-hook

Or add it as a dev dependency in your Cargo.toml file:

[dev-dependencies]
rusty-hook = "0.4.1"

Initialize

Run the init command in any git directory to set it up:

rusty-hook init

This will ensure that all of the client side git hooks are available, and it will create a rusty-hook configuration file if one does not already exist.

Configure

You define your desired git hook configuration in the rusty-hook configuration file (a TOML file named .rusty-hook.toml or rusty-hook.toml).

Here's an example rusty-hook configuration that leverages multiple git hooks, including the pre-commit and the pre-push hooks:

[hooks]
pre-commit = "cargo test"
pre-push = "cargo fmt -- --check"
post-commit = "echo yay"

[logging]
verbose = true

Hooks

Under the [hooks] table, you can add an entry for any and every git hook you want to run by adding a key using the name of the git hook, and then specify the command/script you want to run for that hook. Whenever that git hook is triggered, rusty-hook will run your specified command!

Logging

Under the [logging] table, you can control whether to log the output of running your specified hook commands. By default rusty-hook will log the results of your hook script, but you can disable this behavior by setting the verbose key to false:

[logging]
verbose = false

Alternatives

There's a few other git hook utilities available on crates.io, but none of them quite suited our needs so we made rusty-hook!

Contributions

All contributions are welcome and appreciated! Check out our Contributing Guidelines for more information about opening issues, developing, and more.

rusty-hook's People

Contributors

azure-pipelines[bot] avatar calebcartwright avatar dependabot-support avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.