Skip to content

Pull Request Guidelines

Albert Zeyer edited this page Aug 14, 2020 · 2 revisions

When working on code extension or fixes for RETURNN, there are some useful hints to follow:

Most importantly, follow our contribution guidelines.

Proper PyCharm configuration

RETURNN includes an automatic test case to check for PEP8 code formatting, and setting up PyCharm correctly simplifies the submission process a lot. Also, there are some additional style rules to follow for which PyCharm can be configured. For the details, please have a look at the PyCharm Configuration

Commit message style

The commit messages should follow the recommended 50/72 style, meaning that the commit subject should be around 50 characters (or preferably less), and the commit body around. Do not use git commit -m, but rather do it just with git commit and write the message in your pre-defined editor (vim has automatic commit highlighting) or use PyCharm with the correct configuration. For the commit message itself should be as consistent as possible to previous commit messages.

Rebase before pushing

RETURNN follows the principle of not having any merge-commits in the master branch, so updates on the master while working on a pull requests should be merge by using git pull --rebase only.

Keeping the commit history clean

While working on the pull request it can happen that there are a lot of small commits that need to be joined into larger more reasonable commits. While updating the most recent commit can be done via git commit --amend and a force push to your pull-request branch (e.g. git push --force my-github-repo my-github-branch, the commit history can be cleaned by using git rebase -i. Please have look at some example e.g. Here.