-
-
Notifications
You must be signed in to change notification settings - Fork 395
Setup Gitlint. #645
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
Setup Gitlint. #645
Conversation
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.
@LoopThrough-i-j This looks broadly good to me, though other than the doc updates I'd like to see noted how much is different to in zulip/zulip, and how much is a straight copy (as per my comments).
ZT settled on a slightly different commit format, but I know the API repo matches the main one. That said, I personally prefer the more explicit nature of ZT git-linting since it gives more specific feedback on what is missing/wrong. That may be a discussion for somewhere else, however.
.gitlint
Outdated
@@ -0,0 +1,13 @@ | |||
[general] | |||
ignore=title-trailing-punctuation, body-min-length, body-is-missing, title-imperative-mood |
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.
Did you mean to exclude title-imperative-mood
? Is this is from zulip/zulip? It seems strange to exclude a rule that's added in the extra rules.
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.
I am taking a look and trying to make the required changes. Thanks for the review.
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.
This is wrong in zulip/zulip
; see zulip/zulip#17393. Once that merges, please bring those changes into this PR.
537fcf5
to
5177377
Compare
1889390
to
4b4f6b4
Compare
@alexmv The changes are made. I think they look good to be merged now, still consider reviewing and add any more suggestions if required. |
README.md
Outdated
@@ -25,14 +25,18 @@ and [commit guidelines](https://zulip.readthedocs.io/en/latest/contributing/vers | |||
1. Fork and clone the Git repo: | |||
`git clone https://github.com/<your_username>/python-zulip-api.git` | |||
|
|||
2. Make sure you have [pip](https://pip.pypa.io/en/stable/installing/) | |||
2. Setup upstream and fetch upstream/master (Required for Gitlint): |
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.
Let's spell it [Gitlint](https://jorisroovers.com/gitlint/)
For the files copied from zulip/zulip, can you add a comment noting that's the case at the top of the file? And also mention if anything has changed. Something like:
|
aa02421
to
89b7eae
Compare
7ceb832
to
7585161
Compare
if [[ " | ||
$(git remote -v) | ||
" =~ ' | ||
'([^[:space:]]*)[[:space:]]*(https://github\.com/|ssh://git@github\.com/|git@github\.com:)zulip/python-zulip-api(\.git|/)?\ \(fetch\)' |
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.
Probably we should do a commit to zulip/zulip that makes the repository name a variable at the top of the file.
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.
Okay, we can do that.
Set and Fetch upstream is required for gitlint, while setting up development env.
Setup gitlint for developers to write well formatted commit messages. Note: .gitlint, gitlint-rules.py and lint-commits are taken directly from zulip/zulip with minor changes.
Resolved the minor merge conflict when rebasing and merged, thanks @LoopThrough-i-j! One thing I noticed is that
|
Sure will check and push a fix. Thanks for the merge. |
@@ -15,6 +15,7 @@ EXCLUDED_FILES = [ | |||
def run() -> None: | |||
parser = argparse.ArgumentParser() | |||
add_default_linter_arguments(parser) | |||
parser.add_argument('--no-gitlint', action='store_true', help='Disable gitlint') |
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.
zulint already has an option for this: #659.
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.
Ok, I will create a PR soon, fixing the required changes.
No description provided.