English | 简体中文
You encourage and appreciate researchers and developers to contribute to project PaddleViT. To contribute to PaddlePaddle, you have to agree with the PaddleViT Contributor License Agreement.
This document explains our workflow and working style.
PaddleViT uses this Git branching model. You can follow the listed steps for common contributions.
Please file Pull Requests
from your fork.
To make a fork, just head over to our GitHub repo page and click the "Fork" button.
To make a copy of your fork to your local env:
$ git clone https://github.com/your-github-account/PPViT
$ cd PPViT
For daily works like adding a new feature or fixing a bug, open a feature
branch based on develop
branch before coding:
$ git checkout develop
$ git checkout -b feature
wher feature
can be replaced with the name of your feature you are working on.
Commit your code to the local repository during and after your coding.
$ git add -A
$ git commit -m “message”
- We encourage writing
unittest
to test your class and method. - Please test and report model performance on related datasets before you start to merge.
An experienced Git user pulls from the official repo often -- daily or even hourly, so they notice conflicts with others work early, and it's easier to resolve smaller conflicts.
$ git remote add upstream https://github.com/BR-IDL/PaddleViT
$ git pull upstream develop
-
Push your local work into your forked repo:
$ git push origin my-cool-stuff
The push allows you to create a pull request, requesting owners of this official repo to pull your change into the official one.
-
To create a
Pull Request
, please follow these steps.If your change is for fixing an issue, please write "Fixes " in the description section of your pull request. Github would close the issue when the owners merge your pull request.
Please remember to specify some reviewers for your pull request. If you don't know who are the right ones, please follow Github's recommendation.
After merging into develop
branch successfully, delete your feature
branch.
To keep your local workspace and your fork clean, you might want to remove merged branches:
$ git push origin :my-cool-stuff
$ git checkout develop
$ git pull upstream develop
$ git branch -d my-cool-stuff
-
Please feel free to ping your reviewers by sending them the URL of your pull request via IM or email.
-
Please answer reviewers' every comment. If you are to follow the comment, please write "Done"; please give a reason otherwise.
-
If you don't want your reviewers to get overwhelmed by email notifications, you might reply their comments by in a batch.
-
Reduce the unnecessary commits. Some developers commit often. It is recommended to append a sequence of small changes into one commit by running
git commit --amend
instead ofgit commit
.
Our Python code follows the PEP8 language guide and PEP8 style guide.
Pylint is a Python code analysis tool that analyzes errors in Python code and finds code that does not meet coding style standards and has potential problems.
To make it easier for others to use and generate online documents, please include a docstring for each function on each class method.
Please remember to add related unit tests.
- For Python code, please use Python's standard
unittest
package.
Try to have unit tests for each function on each class method.