GSoC/GCI Archive
Google Code-in 2014 Copyleft Games

HGBot: Check Boilerplate

completed by: Michal Proszek

mentors: Jon Neal, Arc Riley, Terri Oda, David Czech, AJ Williams, Amaury Medeiros

HGBot is a Python program that automates our Mercurial repository management, handles Mercurial authentication, and provides user interfaces such as IRC.

Because individual files from our packages could be found by themselves on the Web, we need to ensure the copyright and license boilerplate is included on each file. There are effectively two different boilerplate templates found in our code; one for languages which comments start with "#" and those which comments can be enclosed with "/* */". You can tell which one needs to be used based on its extension, and there are hundreds of examples between all our projects.

For each file included in the changegroup, evaluate the final (end of changegroup) result to ensure the boilerplate appropriate to its file type is included. Report each file which has a missing or incorrect boilerplate in the push rejection notice.

The failure message should clearly explain what happened and how they need to fix it. This can include a URL, such as a Mercurial tutorial or a page on our wiki, but should also directly provide hg command suggestions without requiring them to read documentation.

This check should not be run on Administrator level users, which may (rarely) need to override this check - such as importing forign files which have a different boilerplate.

While working on this task you should join and remain in #CopyleftGames on Freenode to get help, feedback, and guidance from mentors and other developers. Code updates which may affect your work are also announced here as they happen.

When you've done, commit your work and post the resulting changeset url to this task.