commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
992 stars 1.18k forks source link

Commit template verificator #1529

Open neslihanturan opened 6 years ago

neslihanturan commented 6 years ago

Summary:

We frequently experiences some problems on commit title and description templates. Instead of manually fixing them we can automatize it with a great tool by @refeed (one of our contributors), here is the code: https://phabricator.wikimedia.org/project/profile/2163/

I think we should definitely start to use it and he also offers to send related PR himself. What do you think team?

ujjwalagrawal17 commented 6 years ago

I think it will be a nice addition.

refeed commented 6 years ago

Okay, so in the current commit-message-validator, the rules for GitHub commit message are:

I'm also about to make it configurable, so people can activate or deactivate some rules and let them to set parameter for the rule such as the maximum line length rule. Is there any other commit message rules that this community need? I'd be happy to implement it :)

neslihanturan commented 6 years ago

Great to hear that you want to implement @refeed . Team if you are okay with implementing this, it will be done during the hackathon. What do you say @misaochan ?

misaochan commented 6 years ago

Looks great to me especially if we can easily tweak the rules. :) Sorry for the delayed response, hope you guys still have time to work on it.

neslihanturan commented 6 years ago

Can we discuss which rules we want to tweak? So that @refeed can start to work on.

misaochan commented 6 years ago

His proposal looks perfectly fine to me at first glance:

  • First line <=80 characters
  • Second line blank
  • No line >100 characters (unless it is only a URL)
  • Issue number should not be defined in the header
  • "Closing issue keywords" for closing an issue that is in another repository shouldn't be exist.

I'm also about to make it configurable, so people can activate or deactivate some rules and let them to set parameter for the rule such as the maximum line length rule.

I don't think we will be able to get community consensus quickly enough over the weekend, so it sounds good to me to start with what he proposed first, and then tweak the details later on after we have more time to discuss it.

refeed commented 4 years ago

So I want to update about this again, I'm really sorry for this, unfortunately the code that I had written for wmhack 2018 was deleted accidentally when I was reinstalling my laptop's OS a long time ago, I wanted to say about this earlier but I thought I could write the code again so I delayed it, but I'm busy with my university things now and I think it would take months for the WMF staffs to review my commits since it is kinda a low priority project and well it's not a hackathon anymore (so it's kinda harder to beg the review now).

Apart from my excuses, I also found a nice tool to lint git commits which is used by my other community (github.com/zulip): https://github.com/jorisroovers/gitlint It's already configurable and has many rules http://jorisroovers.com/gitlint/rules/

I don't know if that tool can handle this community's needs, but I think it would be great to discuss it here.

Some tools that I know which I haven't tested yet: