-
Notifications
You must be signed in to change notification settings - Fork 15
kwalitee: addition of sentence dot check #95
kwalitee: addition of sentence dot check #95
Conversation
a296003
to
3f314d2
Compare
@david-caro there are another valid ending: |
Sorry, missed that one. the parenthesis there is something defined? must be on the same line? |
@@ -141,17 +142,26 @@ def _check_bullets(lines, **kwargs): | |||
""" | |||
max_length = kwargs.get("max_length", 72) | |||
labels = {l for l, _ in kwargs.get("commit_msg_labels", tuple())} | |||
signatures = kwargs.get("signatures", tuple()) | |||
|
|||
def _is_signature(line): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To properly find the end of the bullet message, as the signatures don't have a dot they should be treated differently and never be considered part of the dotted message itself.
a9d529d
to
eef49ac
Compare
Sorry for the noise, for now I just expect the '()' to not be multiline, added tests for that case too. |
IMHO we can do it with a regex |
that does not work if the comment is like:
|
True. So we need something like |
at that point in the code, we have a line-by-line loop, so I would have to go reconstructing them. Looks more complicated (also, the regex starts to be complicated too...) |
But you know which is the last line of the bullet point so you can just check that one. |
@@ -142,16 +144,22 @@ def _check_bullets(lines, **kwargs): | |||
max_length = kwargs.get("max_length", 72) | |||
labels = {l for l, _ in kwargs.get("commit_msg_labels", tuple())} | |||
|
|||
def _strip_ticket_directives(line): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm it looks fine.
Cool. I think we can integrate it. Thanks a lot for quick replies! |
@@ -142,16 +144,22 @@ def _check_bullets(lines, **kwargs): | |||
max_length = kwargs.get("max_length", 72) | |||
labels = {l for l, _ in kwargs.get("commit_msg_labels", tuple())} | |||
|
|||
def _strip_ticket_directives(line): | |||
return re.sub(r' \([^)]*\)$', '', line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there might me several * Foo bar. (closes #1) (addresses #2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* -> \{1,\}
* Adds a check for the trailing dots in the bullets of the commit message. Signed-off-by: David Caro <david@dcaro.es>
eef49ac
to
2ab1f74
Compare
Found also another issue, added tests for it too |
Is there anything else I should address? |
oops... did not refresh the page 🙈 |
@david-caro if you have something just open new PR. |
No description provided.