commitplease icon indicating copy to clipboard operation
commitplease copied to clipboard

[Request] Support skipping certain lines being linted for line length

Open jklmli opened this issue 8 years ago • 3 comments

I recently wrote a commit message that contained URLs that were over 100 characters long. That's the upper limit of the AngularJS style guidelines.

Do you plan to support this, and what do you think is a good way of handling this?

jklmli avatar Jul 05 '17 06:07 jklmli

As I understand, commitplease is prohibiting you from using verly long URL's. A quick workaround would be to do it like jquery does: add a regex into markerPattern and ticketPattern in your package.json:

"commitplease": {
    ...
    "markerPattern": "^((clos|fix|resolv)(e[sd]|ing))|^(refs?)",
    "ticketPattern": "^((Closes|Fixes) ([a-zA-Z]{2,}-)[0-9]+)|^(Refs? [^#])"
}

Look at the second OR parts of those regexes:

"commitplease": {
    ...
    "markerPattern": "|^(refs?)",
    "ticketPattern": "|^(Refs? [^#])"
}

Essentially, what it says is that everything starting with a Refs: will be treated as a commit reference. In fact, that is used to provide urls to commit issues. You could pick some other string, like URL or link and use that for links (on separate lines though).

alisianoi avatar Jul 05 '17 08:07 alisianoi

Oh I see, I didn't realize that these patterns excluded the lines from the length check. I'll try that next time.

jklmli avatar Jul 06 '17 08:07 jklmli

The docs never mention this exception, let's update them. @jiaweihli would you do a PR on the README for that?

jzaefferer avatar Jul 20 '17 16:07 jzaefferer