question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Github/Gitlab issue ID support (in subject)

See original GitHub issue

Expected Behavior

Github/Gitlab issue ID (e.g. #123, #6778) can be added as references into subject.

Current Behavior

subject-case now only allows characters

  [
    'lower-case', // default
    'upper-case', // UPPERCASE
    'camel-case', // camelCase
    'kebab-case', // kebab-case
    'pascal-case', // PascalCase
    'sentence-case', // Sentence case
    'snake-case', // snake_case
    'start-case', // Start Case
  ]

Affected packages

  • cli
  • core
  • prompt

Possible Solution

Add regex pattern supports to subject-case, for now, I have to disable subject-case which doesn’t make sense.

commitlint.config.js
{
  "commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ],
    "parserPreset": {
      "parserOpts": {
        "issuePrefixes": [
          "#"
        ]
      }
    },
    "rules": {
      "references-empty": [2,"never"],
      "subject-case": [0,"never"],
      "subject-empty": [2, "never"]
    }
  }
}

Context

Your Environment

Executable Version
commitlint --version v7.0.0
git --version v2.15.2
node --version v10.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
therealklannicommented, Feb 15, 2019

Being able to do this by allowing regular expressions seems like a good solution. Alternately, being able to provide a function (instead of array/string) to the value part of the config…

'some-config': [2, 'always', (commit) => validateThing(commit)]
1reaction
jdbruijncommented, Oct 20, 2020

I’ve created a plugin commitlint-plugin-function-rules, which can be used to write functions for rule values, allowing you to use a regex to specify the allowed values, and much more. I think the issue potentially could be resolved with a function rule and a regex for the subject-case rule (named function-rules/subject-case using the plugin).

I hope this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage issues - GitLab Docs
On the top bar, select Main menu > Projects and find your project. On the left sidebar, select Issues > List. In the...
Read more >
VCS Integration | YouTrack Server Documentation - JetBrains
YouTrack supports direct integration with GitHub, GitLab and Bitbucket. ... Reference an issue ID in a commit message when you push changes ...
Read more >
DevSecOps/CoCoa CLI - IBM Cloud Docs
If --close-resolved-issues flag is set, the command searches for open issues with the same tool, subject and the incident ID as the current...
Read more >
Feature #31989: Inline issue auto complete (#) in ... - Redmine
The attached patch adds support for inline issue auto complete in fields with ... the subject (or at least some keywords from the...
Read more >
Top 100+ Git Interview Questions and Answers [2023 Edition]
Uncover the top 75+ Git interview question that will help you prepare ... GitHub, GitLab and Bitbucket are examples of git repository ______ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found