@dgc-org/commitlint-config-conventional-changelog-for-jira

1.2.6 • Public • Published

@dgc-org/commitlint-config-conventional-changelog-for-jira

Shareable commitlint config enforcing the Angular commit convention and Jira Smart Commit Syntax. Based on @commitlint/config-angular.

Use with @dgc-org/cz-conventional-changelog-for-jira, @commitlint/cli.

Getting started

npm install --save-dev @dgc-org/commitlint-config-conventional-changelog-for-jira @commitlint/cli
echo "module.exports = {extends: ['@dgc-org/commitlint-config-conventional-changelog-for-jira']};" > commitlint.config.js

Disabling commitlint

In some cases it might be useful to be able to skip linting, e.g. when lacking access to Jira or having to do nasty things in GitOps. This configuration skips the linting process altogether if either of these conditions are satisfied:

  • Commit message starts with WIP:, e.g. WIP: the office is burning down, need to save my work
  • Environment variable COMMITLINT_DISABLE is set to true (case-insensitive) or 1

This mechanism should only be used in situations where there's no alternative to it, rather than to ignore fixable validation failures.

Rules

Problems

The following rules are considered problems for @dgc-org/commitlint-config-conventional-changelog-for-jira and will yield a non-zero exit code when not met. Consult docs/rules for a list of available rules.

type-enum

  • condition: type is found in value
  • rule: always
  • value
[
  "feat",
  "fix",
  "docs",
  "refactor",
  "test",
  "style",
  "build",
  "ci",
  "chore",
  "revert",
  "perf",
  "wip",
]
echo "foo: some message" # fails
echo "fix: some message" # passes

type-case

  • description: type is in case value
  • rule: always
  • value
'lowerCase'
echo "FIX: some message" # fails
echo "fix: some message" # passes

type-empty

  • condition: type is empty
  • rule: never
echo ": some message" # fails
echo "fix: some message" # passes

scope-case

  • condition: scope is in case value
  • rule: always
'lowerCase'
echo "fix(SCOPE): some message" # fails
echo "fix(scope): some message" # passes

subject-case

  • condition: subject is in one of the cases ['sentence-case', 'start-case', 'pascal-case', 'upper-case']
  • rule: never
echo "fix(SCOPE): Some message" # fails
echo "fix(SCOPE): Some Message" # fails
echo "fix(SCOPE): SomeMessage" # fails
echo "fix(SCOPE): SOMEMESSAGE" # fails
echo "fix(scope): some message" # passes
echo "fix(scope): some Message" # passes

subject-empty

  • condition: subject is empty
  • rule: never
echo "fix:" # fails
echo "fix: some message" # passes

subject-full-stop

  • condition: subject ends with value
  • rule: never
  • value
'.'
echo "fix: some message." # fails
echo "fix: some message" # passes

header-max-length

  • condition: header has value or less characters
  • rule: always
  • value
72
echo "fix: some message that is way too long and breaks the line max-length by several characters" # fails
echo "fix: some message" # passes

Warnings

The following rules are considered warnings for @dgc-org/commitlint-config-conventional-changelog-for-jira and will print warning messages when not met.

body-leading-blank

  • condition: Body begins with blank line
  • rule: always

Dependents (1)

Package Sidebar

Install

npm i @dgc-org/commitlint-config-conventional-changelog-for-jira

Weekly Downloads

261

Version

1.2.6

License

MIT

Unpacked Size

10.2 kB

Total Files

5

Last publish

Collaborators

  • pldreyer
  • linkjp
  • dede67
  • lednerb
  • itspngu
  • dgc-bot
  • memo21