npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mindblowing/commitlint-plugin-jira-rules

v1.7.0

Published

A plugin that implement all jira commits messages style rules and validate commit messages

Downloads

1,626

Readme

GitHub Multipack

For Tips and Advanced Usage you can read this Blog Post

Getting started.

Install dependencies
npm install --save-dev @commitlint/cli commitlint-plugin-jira-rules commitlint-config-jira
  • commitlint-config-jira - is a recomended config who contain preconfigured rules for jira commits messages style. See all rules in description below
  • commitlint-plugin-jira-rules - is a plugin that implement all jira commits messages style rules and validate commit messages
Configure commitlint to use jira commits messages style config
// commitlint.config.js
module.exports = {
  plugins: ['commitlint-plugin-jira-rules'],
  extends: ['jira'],
}
To lint commits before they are created you can use Husky's 'commit-msg' hook
// package.json
{
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  }
}

Rules

Rules

jira-task-id-empty - this rule check if commit message task id is not empty.

// If your task do not have an id use a conventional task id e.g: IB-0000
// ❌ Bad commit messages
git commit -m"My commit message body"
git commit -m":My commit message body"
// ✅ Good commit messages
git commit -m"IB-2121, IB-21: My commit message body"
git commit -m"IB-0000: My commit message body"

jira-task-id-max-length - this rule check if jira task id length is loonger that the provided value.

// Preconfigured and recommended value in commitlint-config-jira is 9 chars
// ❌ Bad commit messages
git commit -m"IB-2121212121212121: My commit message body"
// ✅ Good commit messages
git commit -m"IB-2121: My commit message body"
git commit -m"IB-21: My commit message body"

jira-task-id-min-length - this rule check if jira task id length is shorter that the provided value.

// Preconfigured and recommended value in commitlint-config-jira is 3 chars
// ❌ Bad commit messages
git commit -m"I1: My commit message body"
// ✅ Good commit messages
git commit -m"IB-2121: My commit message body"
git commit -m"IB-21: My commit message body"

jira-task-id-case - this rule check if taskId is in provided case.

// Preconfigured and recommended value in commitlint-config-jira is "uppercase"
// ❌ Bad commit messages
git commit -m"ib-21: My commit message body"
// ✅ Good commit messages
git commit -m"IB-2121, IB-21: My commit message body"
git commit -m"IB-21: My commit message body"

jira-task-id-project-key - this rule check if commit message task id starts with specific project key.

// Accept a string or an array of strings, by default is disabled
// For example ["PRJ1", "PRJ2"]
// ❌ Bad commit messages
git commit -m"IB-21: My commit message body"
// ✅ Good commit messages
git commit -m"PRJ1-21, PRJ1-22: My commit message body"
git commit -m"PRJ2-21: My commit message body"

jira-commit-status-case - this rule check if commit status is in provided case.

// Preconfigured and recomended value in commitlint-config-jira is "uppercase"
// ❌ Bad commit messages
git commit -m"[wip]IB-21: My commit message body"
// ✅ Good commit messages
git commit -m"[WIP]IB-21: My commit message body"

jira-commit-message-separator - this rule check if commit message separator match provided separator.

// Preconfigured and recomended value in commitlint-config-jira is ":"
// ❌ Bad commit messages
git commit -m"IB-21/ My commit message body"
git commit -m"IB-21 - My commit message body"
git commit -m"IB-21% My commit message body"
// ✅ Good commit messages
git commit -m"IB-21: My commit message body"

Customise/Override commitlint-jira-config rules

For Tips and Advanced Usage you can read this Blog Post

// commitlint.config.js
module.exports = {
  plugins: ['commitlint-plugin-jira-rules'],
  extends: ['jira'],
  rules: {
  // to Customise/Override a rule
+  'jira-task-id-max-length': [2, 'always', 10]
  // to turn off a rule
+ 'jira-task-id-max-length': [0]
  },
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request ;D

Or you can sponsor via Open Collective

Open Collective

Author

@Gherciu/commitlint-jira Released under the MIT License. Authored and maintained by GHERCIU GHEORGHE with help from contributors (list).

If you like this repository star⭐ and watch👀 on GitHub