|
1 | 1 | Getting Started |
2 | 2 | =============== |
3 | 3 |
|
4 | | -Welcome to the ALC AiiDAlab app's developer guide. |
5 | | - |
6 | 4 |
|
7 | 5 | Running The Test Suite |
8 | 6 | ---------------------- |
@@ -39,6 +37,101 @@ or any new modules can be added manually. All docstrings are to be written in `n |
39 | 37 | Coding Style |
40 | 38 | ------------ |
41 | 39 |
|
| 40 | +This project adheres to the `pep8 <https://peps.python.org/pep-0008/>`_ style guide for python coding alongside numpy style docstring formatting. This should be checked before any code updates. A pre-commit configuration using the ruff linter tool is provided for convenience. |
| 41 | + |
42 | 42 |
|
43 | 43 | Contributing |
44 | | ------------- |
| 44 | +------------ |
| 45 | + |
| 46 | +Contributing Workflow |
| 47 | +~~~~~~~~~~~~~~~~~~~~~ |
| 48 | + |
| 49 | +This document outlies the best practices for contributing to the ALC-ux project. These must be |
| 50 | +followed for any contributions to be accepted. In brief the contribution process should be as |
| 51 | +follows: |
| 52 | + |
| 53 | +- Follow the branch, fix, merge model, from your own fork or fork/branch model. |
| 54 | +- Create an issue for all work (bug, feature etc.) |
| 55 | +- Pull requests will not be accepted without review. |
| 56 | +- Any new feature must include appropriate testing. |
| 57 | + |
| 58 | +Using git for development |
| 59 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 60 | + |
| 61 | +The core *upstream* repository is hosted on GitHub which contributors will create forks, from |
| 62 | +using the GitHub web UI, to carry out any development work. This maintains a clean core repository. |
| 63 | +Once a fork has been created the branch, fix, merge workflow should be followed. |
| 64 | + |
| 65 | +**Step 1: Branch** |
| 66 | + |
| 67 | + |
| 68 | +Create a new branch for the issue with an appropriate name (e.g. issueXYZ). This can either |
| 69 | +be carried out through the web UI, then cloned using, |
| 70 | + |
| 71 | +.. code:: bash |
| 72 | +
|
| 73 | + git clone -b issueXYZ --single-branch git@github.com:username/alc-ux.git |
| 74 | +
|
| 75 | +
|
| 76 | +Alternatively, use the CLI directly to create and checkout the new branch, |
| 77 | + |
| 78 | +.. code:: bash |
| 79 | +
|
| 80 | + # clone the repository |
| 81 | + git clone git@github.com:username/alc-ux.git |
| 82 | + # create and checkout a new branch |
| 83 | + git checkout -b issueXYZ |
| 84 | + # create a remote tracking branch |
| 85 | + git push -u origin issueXYZ |
| 86 | +
|
| 87 | +
|
| 88 | +**Step 2: Fix** |
| 89 | + |
| 90 | + |
| 91 | +Here you will fix the issue commit all changes to the new remote tracking branch within |
| 92 | +your fork, ensuring all style guidelines are followed and changes are appropriately |
| 93 | +documented. |
| 94 | + |
| 95 | +**Step 3: Merge** |
| 96 | + |
| 97 | + |
| 98 | +Via the web UI, create a pull request from your development branch into the upstream |
| 99 | +repository. Include any relevant labels or milestones and assign a reviewer. Once the |
| 100 | +request has been created, tests will be run and the review process will begin, which may |
| 101 | +include discussions using the comment system on the pull request. If changes need to be |
| 102 | +made you may make more commits onto your development branch which will be added to the |
| 103 | +pull request automatically. Once all is OK with the commit then the reviewer will set |
| 104 | +the request to be merged once all tests have passed. |
| 105 | + |
| 106 | +If your branch has become out of sync with the *upstream* repository then conflicts |
| 107 | +may arise. If they cannot be resolved automatically by git you will need to resolve them |
| 108 | +by hand as detailed in the GitHub documentation. |
| 109 | + |
| 110 | +It is best practice that when you submit the pull request you squash your commits into |
| 111 | +a single commit that will be applied to the *upstream* repository. This is enabled by |
| 112 | +default and should not be switched off. |
| 113 | + |
| 114 | +**Cleaning stale branches** |
| 115 | + |
| 116 | + |
| 117 | +Deleting branches from the web interface will get rid of the remotes and |
| 118 | +not of your local copies. The local branches left behind are called |
| 119 | +stale branches. To get rid of them |
| 120 | + |
| 121 | +.. code:: bash |
| 122 | +
|
| 123 | + git remote prune origin |
| 124 | +
|
| 125 | +
|
| 126 | +To delete a local branch |
| 127 | + |
| 128 | +.. code:: bash |
| 129 | +
|
| 130 | + git branch -d localBranch |
| 131 | +
|
| 132 | +
|
| 133 | +if unmerged commits exists but you still want to delete use |
| 134 | + |
| 135 | +.. code:: bash |
| 136 | +
|
| 137 | + git branch -D localBranch |
0 commit comments