Skip to content
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

Allow paragraphs or lists in body, not a mix of them #69

Open
knocte opened this issue Feb 10, 2023 · 2 comments
Open

Allow paragraphs or lists in body, not a mix of them #69

knocte opened this issue Feb 10, 2023 · 2 comments

Comments

@knocte
Copy link
Member

knocte commented Feb 10, 2023

Test that should pass (exit code 0):

This is a title

Foo bar baz.

Bar baz foo.

Test that should pass (exit code 0):

This is a title

- Foo bar baz.
- Bar baz foo.

Test that should pass (exit code 0):

This is a title

* Foo bar baz.
* Bar baz foo.

Test that should fail (exit code !== 0):

This is a title

Foo bar baz.
Bar baz foo.
@knocte knocte changed the title Allow paragraphs or lists in body, not a mix of them. Allow paragraphs or lists in body, not a mix of them Feb 10, 2023
@knocte
Copy link
Member Author

knocte commented Feb 10, 2023

This is actually tricky to implement because of these 2 edge cases (should be exitCode = 0):

This is a title

This is a paragraph that has two sentences, each fits in 1 line.
The 2nd sentence.

(See above how 1st line fits 64 chars, so 2nd sentence has to go in next line.)

Another edge case:

This is a title

This commit msg only has 1 paragraph.
FooBarBaz123456789012345678 is a word that is too long to fit in
the first line of the paragraph.

(First line has less than 64 chars, but next word of 2nd sentence doesn't fit.)

@knocte
Copy link
Member Author

knocte commented Feb 10, 2023

Update: after thinking about it a bit more, it looks like this idea would somehow overlap with this other idea I had for another rule:

// * Detect if paragraphs in body have been cropped too shortly (less than 64 chars), and suggest same auto-wrap command that body-soft-max-line-length suggests, since it unwraps and wraps (both).

So maybe we want the rule to be called proper-body-wrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant