Everduin94 / better-commits

A CLI for creating better commits following the conventional commits specification
MIT License
1.96k stars 69 forks source link

feat(main): add body max line length checking #29

Closed Woofenator closed 1 year ago

Woofenator commented 1 year ago

Add checking that the line length of any given body line is not longer than a specified value This satisfies commit body length restrictions. Also includes explicit description of how to create new lines in commit body

Everduin94 commented 1 year ago

Is this specific to a workflow you use? I'm not sure why body length would be restricted per line. If it needs to be restricted, shouldn't footer length per-line be restricted as well?

Woofenator commented 1 year ago

This is mostly specific to commitLint config for conventional commits found here And you are right, footer length should also be limited by body length, will adjust

Everduin94 commented 1 year ago

@Woofenator -- It's okay you don't need to add changes to this PR. There are a lot of changes that are needed to this PR to make it ready to merge, so I'd probably need to add this myself.

Commitlint should still work when you make a commit. Implementing all of these commit lint rules via better-commits validation would be a huge undertaking.

I'd rather follow the pattern better-commits is implementing today and only block the user when totally necessary. i.e. It would probably be preferable to add a config that automatically wraps the users line length. That way they don't have to mess around with \n or get blocked by validation prompts.

Woofenator commented 1 year ago

Collapsing based on line length seems like a very simplistic approach :thinking: Then again, the cli lib does not provide a multi-line input, which would allow the user to input their own paragraphs without relying on a bunch of \ns in their descriptions

Everduin94 commented 1 year ago

@Woofenator -- Yeah I should have mentioned this is mostly a stop gap since the upstream (clack) doesn't support multi-line input. I'm moving this weekend, so I'm a little busy right now, but I'll try to get back to this and look at your other PR when I get the chance.

Everduin94 commented 1 year ago

Closing this