-
Notifications
You must be signed in to change notification settings - Fork 934
support skipping linting #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
TL;DR
The long storycommitlint currently skips commits according to git semantics - meaning that If i understand your use case for this correctly prefixing the
What are your thoughts on this? Beginning commit messages with module.exports = {
rules: {},
ignore: /(^WIP:|\[skip-lint\]$)/
}; |
thanks for the response. hopefully explaining our use case a bit more will clarify things. the main issue is that my team favors continuous integration over feature branches. we will very often merge commits into master that do not complete a thanks for pointing me to the existing ignore rules. i missed those when i was looking through things. i think those make a lot of sense for commits that target squashing later, but when the changes are in master before the remaining commits are completed, the squash approach doesn't fit. i think having i can totally get behind this going into the config as something like other thoughts? |
Understood. I assumed the
|
I threw together a rough todo list @travi. Can you help out on this? |
sure, i'm up for helping move this forward. i have a few things i need to get off my plate before i can start checking things off the list though, so i wont be able to help out immediately |
started to take a look at the change that would be necessary, and it doesnt seem like it will be too bad. i think the only thing that i'm not clear about is the use of |
Thats nice, thanks. 🙇
The regular expressions are fine for internal API but I'd like to avoid them for userland configuration options. Glob patterns are easier than regular expressions and by taking an array of them users should be able to define almost any ignore rule they have in mind. |
sorry to disappear for so long on this issue. i've been tinkering with a few different implementations, but i think i've landed on this being simply unnecessary for my particular use case. i've realized that there are other linting capabilities offered by since since i have a solution for my use case, i probably won't find time to implement this capability at this point. i could still see some value in it for certain cases, but don't have a need for it currently. i'll leave the issue open so that you can decide if it is still functionality that you want, but feel free to close if not. |
there's always an option to setup git hooks on commit message (even easier now with npm package husky), commit, let this package lint. But when you want to skip, simply do a |
the downside of |
Oh, I didn't realize that. Our policy is that we use angular commit message format and we are allowed to do WIP: ... commits, WIP aren't linted and nor are tested for anything, everything else is linted, and WIP are frowned upon, when you do WIP, you should be squashing with a proper commit. Helps keep evetrything clean. |
sure, makes sense. i think that is a pretty common approach. my team's use of essentially, we encourage |
Closing this for now as I feel the need for additional skipping mechanics is rather low. The recommended ways to make commitlint skip over commits are:
|
I'm not sure if I should open a new issue or just leaving this in the same discussion. Right now I'm trying to get this into one of our Projects at work. We are using Bitbucket with the merge commit strategy to merge features/fixes/refactors etc into the develop branch. As of now, there is no way to customize the commit message automatically generated by Bitbucket. It also does not follow basic standards like using present tense words like This is blocking us from implementing Commitlint and I can image other Bitbucket users are experiencing the same. It would be great if we can add one or more custom regexes of commits that should be ignored from the linter through the configuration file. The exact (failing) error messages are these:
|
@byCedric Let's add the bitbucket format to the default ignore wildcards here: https://github.com/marionebl/commitlint/blob/master/%40commitlint/is-ignored/src/index.js Can you send a PR for this? |
@marionebl Sure, I will create one in my lunch break! Approximately in 1 or 2 hours. Thanks for responding this quickly. |
* fix: verify validation url and email * chore: disable one expect * fix: lint issue * fix: fix lint
I solved this with the following:
|
with the transition from
validate-commit-msg
tocommitlint
, 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 withWIP
, 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?The text was updated successfully, but these errors were encountered: