Code Monkey home page Code Monkey logo

sailr's Introduction

Sailr

Sailr helps you follow the Conventional Commits conventional by installing a configurable commit-msg into your Git projects.

Table of Contents

Prerequisites

To use Sailr, you must have jq installed.

Installing

curl -o- https://raw.githubusercontent.com/craicoverflow/sailr/master/scripts/install.sh | bash

Uninstalling

Remove the commit-msg Git hook from your project:

rm <your-project>/.git/hooks/commit-msg

Usage

Once installed, you must run git init in your Git projects to (re)initialize your repository. The hook will look for a configuration file in the following locations (in order):

  1. The root of your Git project.
  2. SAILR_CONFIG: You can set a custom location for your sailr.json config by setting the SAILR_CONFIG environment variable. Example: SAILR_CONFIG=$HOME/.sailr/sailr.json.
{
    "enabled": true,
    "revert": true,
    "length": {
        "min": 1,
        "max": 52
    },
    "types": [
        "build",
        "ci",
        "docs",
        "feat",
        "fix",
        "perf",
        "refactor",
        "style",
        "test",
        "chore"
    ]
}

Note: you can disable Sailr in your project by setting enabled to false in sailr.json.

Unit Testing

Unit tests are written in Python. They are located in ./tests

To run all tests:

make test

sailr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sailr's Issues

error even if the regex matches

I implemented the hook and I get an error even it matches.

[Invalid Commit Message]
------------------------
Valid types: build
 ci
 docs
 feat
 fix
 perf
 refactor
 style
 test
 chore
Max length (first line): 52
Min length (first line): 1
Regex: ^[.0-9]+$|build
|ci
|docs
|feat
|fix
|perf
|refactor
|style
|test
|chore)(\(.+\))?: .{1,52}$
Actual commit message: "refactor(async): almost done"
Actual length: 29

and I also dont get it why my regex has line breaks in it

I am on windows

Does not work when using VSCode as editor

When I commit something, my VSCode editor shows up, I write a message according to the conventional commits page, save and exit but I get this error:

$ git commit -a

[Invalid Commit Message]
------------------------
 choretores: build
Max length (first line): 52
Min length (first line): 1

Regex:
Actual commit message: ""
Actual length: 1

Before installing Sailr I could commit without any issue

Global sailr.json file

If I don't want to include that file in all the project but want to use a global config file for all of my project it is possible?

How would sailr handle breaking changes?

From my understanding, a breaking changes commit message should look like "refactor!: this will mess up things"

I have added the ! versions of the types to my config, but maybe it would be good to add them to the default already?

Dead article link

The https://endaphelan.me/guides/git/using-git-hooks-to-enforce-conventional-commits/ link which should point to the article responds with an HTTP 404.

image

There seems to be a copy here.

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.