GithubHelp home page GithubHelp logo

ricadesign / conventional-commits Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 13 KB

Script to configure commit-msg hook in order to comply converntional commits in your local repository

Shell 100.00%

conventional-commits's Introduction

Conventional Commit Script

This script sets up a commit-msg hook in a Git repository to enforce a conventional commit message format based on the Conventional Commits specification.

Installation and Configuration

./conventional-commit.sh <directory_path> [options]
  • <directory_path>: Provide the directory path where the script should act as the first parameter.

Options

  • -h, --help: Show the help message.
  • --disable: Disable the commit-msg hook.

Usage

  1. Run the script with the desired directory path as the first parameter:

    ./conventional-commit.sh <directory_path>

    This will create the commit-msg hook in the specified directory.

  2. To disable the commit-msg hook, use the --disable option as the second parameter:

    ./conventional-commit.sh <directory_path> --disable

    This will remove the commit-msg hook from the specified directory.

Commit Message Format

The script enforces the following format for commit messages:

<type>(<scope>): <subject>
  • <type>: Type of the commit. It can be one of the following values: feat, fix, refactor, style, test, docs, build, lang, chore.
  • <scope> (optional): Scope or context of the commit. It should be a short description (up to 20 characters).
  • <subject>: A concise and descriptive message (up to 100 characters) about the commit.

If the commit message does not match the specified format, an error will be displayed, and the commit will be rejected.

Example

./conventional-commit.sh my_project/

This example runs the script in the my_project/ directory, setting up the commit-msg hook for the Git repository located in that directory.

Please note that this script assumes you have appropriate permissions to modify the Git repository and its hooks.

conventional-commits's People

Contributors

jperez8 avatar

Stargazers

 avatar

Watchers

 avatar

conventional-commits's Issues

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.