All Projects → captainhookphp → Captainhook

captainhookphp / Captainhook

Licence: mit
Very flexible git hook manager for php developers

Projects that are alternatives of or similar to Captainhook

Yarnhook
Run `yarn install`, `npm install` or `pnpm install` on git hooks automatically
Stars: ✭ 177 (-63.51%)
Mutual labels:  hacktoberfest, git-hooks
Talisman
By hooking into the pre-push hook provided by Git, Talisman validates the outgoing changeset for things that look suspicious - such as authorization tokens and private keys.
Stars: ✭ 1,155 (+138.14%)
Mutual labels:  hacktoberfest, git-hooks
Ember Bootstrap
Ember-cli addon for using Bootstrap as native Ember components.
Stars: ✭ 475 (-2.06%)
Mutual labels:  hacktoberfest
Laravel Dompdf
A DOMPDF Wrapper for Laravel
Stars: ✭ 4,978 (+926.39%)
Mutual labels:  hacktoberfest
Droplet kit
DropletKit is the official DigitalOcean API client for Ruby.
Stars: ✭ 482 (-0.62%)
Mutual labels:  hacktoberfest
Rust Sloth
A 3D software rasterizer... for the terminal!
Stars: ✭ 478 (-1.44%)
Mutual labels:  hacktoberfest
Quartznet
Quartz Enterprise Scheduler .NET
Stars: ✭ 4,825 (+894.85%)
Mutual labels:  hacktoberfest
Preact Cli
😺 Your next Preact PWA starts in 30 seconds.
Stars: ✭ 4,510 (+829.9%)
Mutual labels:  hacktoberfest
Domjudge
DOMjudge programming contest jury system
Stars: ✭ 484 (-0.21%)
Mutual labels:  hacktoberfest
Git Fresh
🍋 Keep your Git repo fresh.
Stars: ✭ 480 (-1.03%)
Mutual labels:  hacktoberfest
Msbuild
The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
Stars: ✭ 4,643 (+857.32%)
Mutual labels:  hacktoberfest
Code Golf
A game designed to let you show off your code-fu by solving problems in the least number of characters.
Stars: ✭ 479 (-1.24%)
Mutual labels:  hacktoberfest
Devchallenge
A website for developers to improve their skills by doing front-end and back-end challenges
Stars: ✭ 475 (-2.06%)
Mutual labels:  hacktoberfest
Ferret
Declarative web scraping
Stars: ✭ 4,837 (+897.32%)
Mutual labels:  hacktoberfest
30 Seconds Of Swift Code
A Swift implementation of 30-seconds-of-code: A curated collection of useful Swift 4 snippets that you can understand in 30 seconds or less.
Stars: ✭ 476 (-1.86%)
Mutual labels:  hacktoberfest
Quiche
🥧 Savoury implementation of the QUIC transport protocol and HTTP/3
Stars: ✭ 5,481 (+1030.1%)
Mutual labels:  hacktoberfest
Practical rl
A course in reinforcement learning in the wild
Stars: ✭ 4,741 (+877.53%)
Mutual labels:  hacktoberfest
Ztm Job Board
⚛️ A place for developers to show recruiters they are available for hire
Stars: ✭ 480 (-1.03%)
Mutual labels:  hacktoberfest
Pnpjs
Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
Stars: ✭ 484 (-0.21%)
Mutual labels:  hacktoberfest
Mvikotlin
Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel)
Stars: ✭ 483 (-0.41%)
Mutual labels:  hacktoberfest

Latest Stable Version Minimum PHP Version Downloads License Build Status Scrutinizer Code Quality Code Coverage Twitter

CaptainHook

CaptainHook logo

CaptainHook is an easy to use and very flexible git hook library for php developers. It enables you to configure your git hook actions in a simple json file.

You can use CaptainHook to validate or prepare your commit messages, ensure code quality or run unit tests before you commit or push changes to git. You can automatically clear local caches or install the latest composer dependencies after pulling the latest changes.

CaptainHook makes it easy to share hooks within your team and even can make sure that everybody in your team activates the hooks locally.

You can run cli commands, use some built in validators, or write your own PHP classes that get executed by CaptainHook. For more information have a look at the documentation.

Installation

Install the CaptainHook PHAR using Phive or download the PHAR from the github release page.

    $ phive install captainhook

Or use Composer to install CaptainHook.

    $ composer require --dev captainhook/captainhook

Setup

After installing CaptainHook you can use the captainhook executable to create a configuration.

    $ vendor/bin/captainhook configure

Now there should be a captainhook.json configuration file.

If you are not using the composer-plugin yet you have to activate the hooks manually by installing them to your local .git repository. To do so just run the following captainhook command.

    $ vendor/bin/captainhook install

Have a look at this short installation video.

Install demo

If you want to make sure your whole team uses the same hooks and you want to make sure everybody has the hooks installed you can use the CaptainHook composer-plugin as an addition.

    $ composer require --dev captainhook/plugin-composer

The plugin will make sure that the hooks get activated after every composer install or update. If you don't like the extra dependency just add the following scripts command to your composer.json file instead.

{
  "scripts": {
    "post-autoload-dump": "vendor/bin/captainhook install -f -s"
  }
}

Configuration

Here's an example captainhook.json configuration file.

{
  "commit-msg": {
    "enabled": true,
    "actions": [
      {
        "action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
        "options": []
      }
    ]
  },
  "pre-commit": {
    "enabled": true,
    "actions": [
      {
        "action": "phpunit"
      },
      {
        "action": "phpcs --standard=psr2 src"
      }
    ]
  },
  "pre-push": {
    "enabled": false,
    "actions": []
  }
}

Contributing

So you'd like to contribute to the CaptainHook library? Excellent! Thank you very much. I can absolutely use your help.

Have a look at the contribution guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].