Before writing code, we strongly advise you to search through the existing PRs or issues to make sure that nobody is already working on the same thing. If you are unsure, it is always a good idea to open an issue to get some feedback.
You will need basic git
proficiency to be able to contribute to
bridge-inspection-toolkit
. git
is not the easiest tool to use but it has the greatest
manual. Type git --help
in a shell and enjoy. If you prefer books, Pro
Git is a very good reference.
Follow these steps to start contributing:
-
Fork the repository by clicking on the 'Fork' button on the repository's page. This creates a copy of the code under your GitHub user account.
-
Clone your fork to your local disk, and add the base repository as a remote:
$ git clone [email protected]:<YourGithubName>/bridge-inspection-toolkit.git $ cd bridge-inspection-toolkit $ git remote add upstream https://github.com/phiyodr/bridge-inspection-toolkit.git
-
Create a new branch to hold your development changes:
$ git checkout -b a-descriptive-name-for-my-changes
Do not work on the
master
branch. -
Set up a development environment by running the following command in a virtual environment:
$ pip install -e .
(If bridge-inspection-toolkit was already installed in the virtual environment, remove it with
pip uninstall bikit
before reinstalling it in editable mode with the-e
flag.) -
Develop the features on your branch.
As you work on the features, you should make sure that the test suite passes:
# cd bridge-inspection-toolkit/ pytest
Once you're happy with your changes, add changed files using
git add
and make a commit withgit commit
to record your changes locally:$ git add modified_file.py $ git commit
Please write good commit messages.
It is a good idea to sync your copy of the code with the original repository regularly. This way you can quickly account for changes:
$ git fetch upstream $ git rebase upstream/master
Push the changes to your account using:
$ git push -u origin a-descriptive-name-for-my-changes
-
Once you are satisfied (and the checklist below is happy too), go to the webpage of your fork on GitHub. Click on 'Pull request' to send your changes to the project maintainers for review.
-
So everyone can see the changes in the Pull request, work in your local branch and push the changes to your fork. They will automatically appear in the pull request.
- The title of your pull request should be a summary of its contribution;
- If your pull request addresses an issue, please mention the issue number in the pull request description to make sure they are linked (and people consulting the issue know you are working on it);
- To indicate a work in progress please prefix the title with
[WIP]
. These are useful to avoid duplicated work, and to differentiate it from PRs ready to be merged; - Make sure existing tests pass;
- All public methods must have informative docstrings.
Run tests with
# cd bridge-inspection-toolkit/
pytest
For documentation strings, bikit
follows the google style.