0.0.3 • Published 5 years ago

linted-git-commit v0.0.3

Weekly downloads
2
License
Apache Public Lic...
Repository
github
Last release
5 years ago

Greenkeeper badge Build Status

linted-git-commit

Lints commit message using commitlint, commits if message is valid.

Also can show markdowned help message from your ~/.commitlintrc.yml

asciicast

Install

# Install commitlint cli, config and linted-git-commit
npm install -g @commitlint/{config-conventional,cli} linted-git-commit

# configure commitlint to use config and show help message
cat << EOF > ~/.commitlintrc.yml
---
extends:
  - '@commitlint/config-conventional'
rules:
  type-enum:
  - 2
  - always
  - - chore
    - ci
    - feat
    - fix
    - docs
    - style
    - refactor
    - perf
    - test
    - revert
help: |
  **Possible types**:

  `chore`:    Change build process, tooling or dependencies.
  `ci`:       Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  `feat`:     Adds a new feature.
  `fix`:      Solves a bug.
  `docs`:     Adds or alters documentation.
  `style`:    Improves formatting, white-space.
  `refactor`: Rewrites code without feature, performance or bug changes.
  `perf`:     Improves performance.
  `test`:     Adds or modifies tests.
  `revert`:   Changes that reverting other changes
EOF

# make aliases
cat << EOF >> ~/.zshrc
alias lc="linted-git-commit"
alias lc!="linted-git-commit --amend"
EOF

# and use it like
gaa && lc -m "feat: added linted-git-commit"

# all unknown parameters goes to git
lc! -m "feat: added linted-git-commit" --no-verify