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.

support skipping linting

See original GitHub issue

with the transition from validate-commit-msg to commitlint, one missing feature that i notice is the ability specify that a commit should skip linting by including a keyword in the message. i initially asked if this would be added in the thread about the transition, but was righty directed here to open an issue.

in the case of validate-commit-msg, the keyword was simply starting the commit message with WIP, which has worked well for us when a commit is a step toward one of the categories, but does not complete the effort.

would it be possible to support similar functionality in commitlint to save us from needing to configure some sort of wrapper in all of our projects?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
byCedriccommented, Mar 2, 2018

@marionebl Sure, I will create one in my lunch break! Approximately in 1 or 2 hours. Thanks for responding this quickly.

2reactions
marioneblcommented, Aug 14, 2017

TL;DR

  • Git has the fixup! and squash! semantics
  • commitlint uses said semantics to determine ignored commits
  • I prefer sticking to git semantics to keep things simple
  • Let’s discuss use cases that do not fit fixup! and squash! semantics
  • If we add this it should be configurable

The long story

commitlint currently skips commits according to git semantics - meaning that merge, fixup and squash commits are ignored automatically. The relevant test cases can be found here.

If i understand your use case for this correctly prefixing the WIP commits with fixup! instead could be the idiomatic way to ignore commits. E.g.:

  • WIP: This is something I id =>fixup! This is something I did
  • WIP: Some more work =>squash! Some more work

What are your thoughts on this?

Beginning commit messages with WIP feels different to me as git itself does not attach additional semantics to it. If we add this functionality I’d tend to go with some regex option matching commits that should be ignored, e.g.

module.exports = {
  rules: {},
  ignore: /(^WIP:|\[skip-lint\]$)/
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Lint Code: What Is Linting + When To Use Lint Tools - Perforce
Linting is important to reduce errors and improve the overall quality of your code. Using lint tools can help you accelerate development and ......
Read more >
A Complete Guide to Linting Go Programs - freshman.tech
This article demonstrates a comprehensive linting setup for Go projects, and discusses the best way to introduce it into an existing ...
Read more >
Linting Python in Visual Studio Code
Linting highlights syntactical and stylistic problems in your Python source code, which often helps you identify and correct subtle programming errors or ...
Read more >
Improve your code with lint checks - Android Developers
Android Studio provides a code scanning tool called lint that can help you to identify and correct problems with the structural quality of...
Read more >
Configuration - golangci-lint
There is a .golangci.reference.yml file with all supported options, their description, ... Which dirs to skip: issues from them won't be reported.
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