Skip to content

Commit 6083d3c

Browse files
Gregory Gundersenmax-sixty
authored andcommitted
Add PR checklist to contributing docs (#3226)
* Draft of PR checklist. * Clean up and formatting. * Added pre-commit suggestion. Co-Authored-By: Maximilian Roos <[email protected]> * Added PR checklist.
1 parent 7866587 commit 6083d3c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

doc/contributing.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,3 +842,22 @@ branch has not actually been merged.
842842
The branch will still exist on GitHub, so to delete it there do::
843843
844844
git push origin --delete shiny-new-feature
845+
846+
847+
PR checklist
848+
------------
849+
850+
- **Properly comment and document your code.** See `"Documenting your code" <https://xarray.pydata.org/en/stable/contributing.html#documenting-your-code>`_.
851+
- **Test that the documentation builds correctly** by typing ``make html`` in the ``doc`` directory. This is not strictly necessary, but this may be easier than waiting for CI to catch a mistake. See `"Contributing to the documentation" <https://xarray.pydata.org/en/stable/contributing.html#contributing-to-the-documentation>`_.
852+
- **Test your code**.
853+
854+
- Write new tests if needed. See `"Test-driven development/code writing" <https://xarray.pydata.org/en/stable/contributing.html#test-driven-development-code-writing>`_.
855+
- Test the code using `Pytest <http://doc.pytest.org/en/latest/>`_. Running all tests (type ``pytest`` in the root directory) takes a while, so feel free to only run the tests you think are needed based on your PR (example: ``pytest xarray/tests/test_dataarray.py``). CI will catch any failing tests.
856+
857+
- **Properly format your code** and verify that it passes the formatting guidelines set by `Black <https://black.readthedocs.io/en/stable/>`_ and `Flake8 <http://flake8.pycqa.org/en/latest/>`_. See `"Code formatting" <https://xarray.pydata.org/en/stablcontributing.html#code-formatting>`_. You can use `pre-commit <https://pre-commit.com/>`_ to run these automatically on each commit.
858+
859+
- Run ``black .`` in the root directory. This may modify some files. Confirm and commit any formatting changes.
860+
- Run ``flake8`` in the root directory. If this fails, it will log an error message.
861+
862+
- **Push your code and** `create a PR on GitHub <https://help.github.com/en/articles/creating-a-pull-request>`_.
863+
- **Use a helpful title for your pull request** by summarizing the main contributions rather than using the latest commit message. If this addresses an `issue <https://github.com/pydata/xarray/issues>`_, please `reference it <https://help.github.com/en/articles/autolinked-references-and-urls>`_.

doc/whats-new.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ Bug fixes
9191

9292
.. _whats-new.0.12.3:
9393

94+
Documentation
95+
~~~~~~~~~~~~~
96+
97+
- Created a `PR checklist <https://xarray.pydata.org/en/stable/contributing.html/contributing.html#pr-checklist>`_ as a quick reference for tasks before creating a new PR
98+
or pushing new commits.
99+
By `Gregory Gundersen <https://github.com/gwgundersen>`_.
100+
94101
v0.12.3 (10 July 2019)
95102
----------------------
96103

0 commit comments

Comments
 (0)