Captain

0.2.0

makes easy to manage git hooks for written in Swift products
yanamura/Captain

What's New

Release 0.2.0

2020-06-27T14:04:17Z

Drop Support: Swift4.2, Swift5.0

Captain

travis Swift 5.1

Captain makes easy to manage git hooks

Install

Using Mint

if you want to install globally, use Mint

$ mint install yanamura/Captain

build yourself

$ git clone https://github.com/yanamura/Captain
$ cd Captain
$ swift build -c release

executable binary will be created to ./build/release/captain

Usage

Configuration

create .captain onproject root directory.

/ProjectDir
  /.git
  .gitignore
  .captain

.git directory and .captain file should be in same location.

.captain

{
  "pre-commit": "swift-format -r Sources -i"
}

or

{
  "pre-commit": [
    "swift-format -r Sources -i",
    "git add ."
  ]
}

supported hooks

  • applypatch-msg
  • pre-applypatch
  • post-applypatch
  • pre-commit
  • prepare-commit-msg
  • commit-msg
  • post-commit
  • pre-rebase
  • post-checkout
  • post-merge
  • pre-push
  • pre-receive
  • update
  • post-receive
  • post-update
  • push-to-checkout
  • pre-auto-gc
  • post-rewrite
  • sendemail-validat

Set Git Hooks

$ captain install

Using Swift Package Manager

/// Package.swift
    dependencies: [
        ...
        .package(url: "https://github.com/yanamura/Captain"),
    ]
$ swift run -c release captain install

Using Mint

$ mint run yanamura/Captain captain install

Using cloned repository

$ git clone https://github.com/yanamura/Captain
$ cd Captain
$ swift run captain install

Unset Git Hooks

$ captain uninstall

Description

  • Swift Tools 4.0.0
View More Packages from this Author

Dependencies

Last updated: Mon Apr 15 2024 07:36:29 GMT-0900 (Hawaii-Aleutian Daylight Time)