-
Notifications
You must be signed in to change notification settings - Fork 300
Developer guide overhaul #3852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
trexfeathers
merged 12 commits into
SciTools:master
from
tkknight:developer_guide_overhaul
Sep 18, 2020
Merged
Developer guide overhaul #3852
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d0cf5f2
developer guide overhaul baseline
tkknight 9655aab
added todo
tkknight 4d01da0
added todos
tkknight bbc9137
Addressed all todos.
tkknight 7f1e58f
Merge branch 'master' into developer_guide_overhaul
tkknight 5f1a0c8
Updated PR template
tkknight 7138ca4
Corrected spelling
tkknight 908ba1c
Used ref intead of a relative url.
tkknight 0fc9c52
Added a ref for the developers guide
tkknight ddad96b
Minor updates to address reviewer comments
tkknight 07cc7ed
review action: fix generated dir reference
bjlittle 232f384
review actions
bjlittle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1 @@ | ||
| How to contribute | ||
| ================= | ||
|
|
||
| We want Iris to be driven by the community - your contributions are | ||
| invaluable to us! This page lists the guidelines for contributors which | ||
| will help ease the process of getting your hard work accepted into Iris, | ||
| and shared back to the world. | ||
|
|
||
| Getting started | ||
| --------------- | ||
|
|
||
| 1. If you've not already got one, sign up for a | ||
| [GitHub account](https://github.com/signup/free). | ||
| 1. Fork the Iris repository, create your new fix/feature branch, and | ||
| start commiting code. | ||
| - Our | ||
| [development guide](https://scitools.org.uk/iris/docs/latest/developers_guide/index.html) | ||
| has more detail. | ||
| 1. Make sure you've added appropriate tests, and that *all* the tests | ||
| pass. | ||
|
|
||
|
|
||
| Submitting changes | ||
| ------------------ | ||
|
|
||
| 1. Read and sign the Contributor Licence Agreement (CLA). | ||
| - See our [governance page](http://scitools.org.uk/governance.html) | ||
| for the CLA and what to do with it. | ||
| 1. Push your branch to your fork of Iris. | ||
| 1. Submit your pull request. | ||
| 1. Chillax. | ||
|
|
||
|
|
||
| If in doubt, please | ||
| [contact us](https://groups.google.com/forum/?fromgroups=#!forum/scitools-iris) | ||
| on our Google Group, and we'll be happy to help you. | ||
| See the [Developers Guide](https://scitools-iris.readthedocs.io/en/latest/index.html#development-index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| .. _SciTools: https://github.com/SciTools | ||
| .. _Iris: https://github.com/SciTools/iris | ||
| .. _Iris GitHub: https://github.com/SciTools/iris | ||
| .. _iris mailing list: https://groups.google.com/forum/#!forum/scitools-iris | ||
| .. _issue: https://github.com/SciTools/iris/issues | ||
| .. _issues: https://github.com/SciTools/iris/issues | ||
| .. _pull request: https://github.com/SciTools/iris/pulls | ||
| .. _pull requests: https://github.com/SciTools/iris/pulls | ||
| .. _contributor: https://github.com/SciTools/scitools.org.uk/blob/master/contributors.json | ||
| .. _core developers: https://github.com/SciTools/scitools.org.uk/blob/master/contributors.json | ||
| .. _iris-test-data: https://github.com/SciTools/iris-test-data | ||
| .. _iris-sample-data: https://github.com/SciTools/iris-sample-data | ||
| .. _test-iris-imagehash: https://github.com/SciTools/test-iris-imagehash | ||
| .. _readthedocs.yml: https://github.com/SciTools/iris/blob/master/requirements/ci/readthedocs.yml | ||
| .. _travis-ci: https://travis-ci.org/github/SciTools/iris | ||
| .. _.travis.yml: https://github.com/SciTools/iris/blob/master/.travis.yml | ||
| .. _.stickler.yml: https://github.com/SciTools/iris/blob/master/.stickler.yml | ||
| .. _.flake8.yml: https://github.com/SciTools/iris/blob/master/.flake8 | ||
| .. _GitHub Help Documentation: https://docs.github.com/en/github | ||
| .. _using git: https://docs.github.com/en/github/using-git | ||
| .. _generating sss keys for GitHub: https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account | ||
| .. _New Issue: https://github.com/scitools/iris/issues/new/choose | ||
| .. _matplotlib: https://matplotlib.org/ | ||
| .. _conda: https://docs.conda.io/en/latest/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| .. _contributing.changes: | ||
|
|
||
| Contributing your changes | ||
| ========================= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 3 | ||
|
|
||
| documenting/whats_new_contributions | ||
| contributing_pull_request_checklist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| .. _developer_testing_ci: | ||
|
|
||
| .. include:: ../common_links.inc | ||
|
|
||
| Continuous Integration (CI) Testing | ||
| =================================== | ||
|
|
||
| The `Iris`_ GitHub repository is configured to run checks on the code | ||
| automatically when a pull request is created, updated or merged against | ||
| Iris **master**. The checks performed are: | ||
|
|
||
| * :ref:`testing_cla` | ||
| * :ref:`testing_travis` | ||
| * :ref:`testing_stickler` | ||
|
|
||
|
|
||
| .. _testing_cla: | ||
|
|
||
| SciTools CLA Checker | ||
| ******************** | ||
|
|
||
| A bot that checks the user who created the pull request has signed the | ||
| **Contributor's License Agreement (CLA)**. For more information on this this | ||
| please see https://scitools.org.uk/organisation.html#governance | ||
|
|
||
|
|
||
| .. _testing_stickler: | ||
|
|
||
| Stickler CI | ||
| *********** | ||
|
|
||
| Automatically enforces coding standards. The configuration file named | ||
| `.stickler.yml`_ is in the Iris_ root directory. For more information see | ||
| https://stickler-ci.com/. | ||
|
|
||
|
|
||
| .. _testing_travis: | ||
|
|
||
| Travis-CI | ||
| ********* | ||
|
|
||
| The unit and integration tests in Iris are an essential mechanism to ensure | ||
| that the Iris code base is working as expected. :ref:`developer_running_tests` | ||
| may be run manually but to ensure the checks are performed a | ||
| continuous integration testing tool named `travis-ci`_ is used. | ||
|
|
||
| A `travis-ci`_ configuration file named `.travis.yml`_ | ||
| is in the Iris repository which tells travis-ci what commands to run. The | ||
| commands includes retrieving the Iris code base and associated test files using | ||
trexfeathers marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| conda and then running the tests. `travis-ci`_ allows for a matrix of tests to | ||
| be performed to ensure that all expected variations test successfully. | ||
|
|
||
| The `travis-ci`_ tests are run automatically against the `Iris`_ master | ||
| repository when a pull requests is submitted, updated or merged. | ||
trexfeathers marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The example snapshot from a GitHub pull request shows all test passing. | ||
trexfeathers marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .. image:: ci_checks.png | ||
|
|
||
| If any checks fail the pull requests is unlikely to be merged to the Iris | ||
trexfeathers marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| **master**. | ||
|
|
||
59 changes: 59 additions & 0 deletions
59
docs/iris/src/developers_guide/contributing_code_formatting.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| .. include:: ../common_links.inc | ||
|
|
||
| .. _code_formatting: | ||
|
|
||
| Code formatting | ||
| =============== | ||
|
|
||
| To ensure a consistent code format throughout Iris, we recommend using | ||
| tools to check the source directly. | ||
|
|
||
| * `black`_ for an opinionated coding auto-formatter | ||
| * `flake8`_ linting checks | ||
|
|
||
| The preferred way to run these tools automatically is to setup and configure | ||
| `pre-commit`_. | ||
|
|
||
| You can install ``pre-commit`` in your development environment using ``pip``:: | ||
|
|
||
| $ pip install pre-commit | ||
|
|
||
| or alternatively using ``conda``:: | ||
|
|
||
| $ conda install -c conda-forge pre-commit | ||
tkknight marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| In order to to install the ``pre-commit`` git hooks defined in our | ||
| ``.pre-commit-config.yaml`` file you must run the following command from the | ||
trexfeathers marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| root directory of Iris:: | ||
|
|
||
| $ pre-commit install | ||
|
|
||
| Upon performing a ``git commit``, your code will now be automatically formatted | ||
| to the ``black`` configuration defined in our ``pyproject.toml`` file, and | ||
| linted according to our ``.flake8`` configuration file. Note that, | ||
| ``pre-commit`` will automatically download and install the necessary packages | ||
| for each ``.pre-commit-config.yaml`` git hook. | ||
|
|
||
| Additionally, you may wish to enable ``black`` for your preferred | ||
| `editor/IDE <https://black.readthedocs.io/en/stable/editor_integration.html#editor-integration>`_. | ||
|
|
||
| With the ``pre-commit`` configured, the output of performing a ``git commit`` | ||
| will look similar to:: | ||
|
|
||
| Check for added large files..............................................Passed | ||
| Check for merge conflicts................................................Passed | ||
| Debug Statements (Python)............................(no files to check)Skipped | ||
| Don't commit to branch...................................................Passed | ||
| black................................................(no files to check)Skipped | ||
| flake8...............................................(no files to check)Skipped | ||
| [contribution_overhaul c8513187] this is my commit message | ||
| 2 files changed, 10 insertions(+), 9 deletions(-) | ||
|
|
||
|
|
||
| .. note:: You can also run `black`_ and `flake8`_ manually. Please see the | ||
| their officially documentation for more information. | ||
|
|
||
|
|
||
| .. _black: https://black.readthedocs.io/en/stable/ | ||
| .. _flake8: https://flake8.pycqa.org/en/stable/ | ||
| .. _pre-commit: https://pre-commit.com/ | ||
13 changes: 13 additions & 0 deletions
13
docs/iris/src/developers_guide/contributing_codebase_index.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| .. _contributing.documentation.codebase: | ||
|
|
||
| Contributing to the code base | ||
| ============================= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 3 | ||
|
|
||
| contributing_code_formatting | ||
| documenting/docstrings | ||
| documenting/rest_guide | ||
| contributing_deprecations | ||
| contributing_testing_index |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.