Skip to content
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

Tweak format and wording of contributor doc #566

Merged
merged 8 commits into from
Aug 26, 2024
64 changes: 36 additions & 28 deletions doc/source/contributing/how_to_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,70 @@
How to Contribute
=================

On this page we briefly provide basic instructions for contributing to icepyx.
On this page we provide brief instructions for contributing to icepyx.
We encourage users to follow the `git pull request workflow <https://www.asmeurer.com/git-workflow/>`_.
For contribution examples, please see contribution guidelines.
For contribution examples, please see :doc:`contribution guidelines <contribution_guidelines>`.


Contributing for the first time
-------------------------------
1. If you don't have one, sign up for a GitHub account (visit https://github.com/ and ‘sign up for GitHub account’).

2. Clone the icepyx repo: Open a terminal window.
Navigate to the folder on your computer where you want to store icepyx.
For example,
Navigate to the folder on your computer where you want to store icepyx.
For example,
JessicaS11 marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: shell
.. code-block:: shell

cd /Users/YOURNAMEHERE/documents/ICESat-2
cd /Users/YOURNAMEHERE/documents/ICESat-2

Within this folder, clone the icepyx repo by executing
Within this folder, clone the icepyx repo by executing

.. code-block:: shell
.. code-block:: shell

git clone https://github.com/icesat2py/icepyx.git
git clone https://github.com/icesat2py/icepyx.git

You should receive confirmation in terminal of the files loading into your workspace.
For help navigating git and GitHub, see this `guide <https://the-turing-way.netlify.app/collaboration/github-novice/github-novice-firststeps.html?highlight=github%20account>`__.
`GitHub <https://docs.github.com/en>`_ also provides a lot of great how-to materials for navigating and contributing.
You should receive confirmation in terminal of the files downloading into your workspace.
For help navigating ``git`` and GitHub, see this `guide <https://the-turing-way.netlify.app/collaboration/github-novice/github-novice-firststeps.html?highlight=github%20account>`__.
`GitHub <https://docs.github.com/en>`_ also provides great how-to materials for navigating and contributing.


Every time you contribute
-------------------------

.. important::

If you do not have write permissions on this repository, start with creating a fork by clicking the Fork button in GitHub.
All actions from here on should be performed in your fork.

1. To add new content, you need to create a new branch.
You can do this on GitHub by clicking the down arrow next to ‘development’ and making a new branch
(you can give it whatever name you want - the naming doesn't matter much as it will only be a temporary branch).
You can do this on GitHub by clicking the down arrow next to ‘development’ and making a new branch
(you can give it whatever name you want - the naming doesn't matter much as it will only be a temporary branch).

2. Navigate to the new branch you created.
Make any edits or additions on this branch (this can be done locally or on GitHub directly).
After you do this, commit your changes and add a descriptive commit message.
Make any edits or additions on this branch (this can be done locally with ``git`` or on GitHub directly).
After you do this, commit your changes and add a descriptive commit message.

3. After committing the changes, push them to GitHub if you were working locally.
Then, open a pull request to merge your branch into the development branch.
Members of the icepyx community will review your changes and may ask you to make some more.
3. Push your new commits to GitHub if you were working locally.
Then, open a pull request to merge your branch into the ``development`` branch.
Members of the icepyx community will review your changes and may ask you to make some more.

4. If this is your first PR, someone on the icepyx team should add you to the contributors list.
icepyx follows the `all-contributors <https://github.com/all-contributors/all-contributors>`_ specification using the contributors bot to add new contributors.
You are also welcome to add yourself by adding a comment with the text:
icepyx follows the `all-contributors <https://github.com/all-contributors/all-contributors>`_ specification using the contributors bot to add new contributors.
You are also welcome to add yourself by adding a comment with the text:

.. code-block:: none
.. code-block:: none

@all-contributors add @[GitHub_handle] for a, b, and c
@all-contributors add @[GitHub_handle] for a, b, and c

where a, b, etc. is a list of the appropriate `contribution emojis <https://allcontributors.org/docs/en/emoji-key>`_.
The bot will open a separate PR to add the contributor or new contribution types!
where a, b, etc. is a list of the appropriate `contribution emojis <https://allcontributors.org/docs/en/emoji-key>`_.
The bot will open a separate PR to add the contributor or new contribution types!

5. Repeat these steps, creating a new branch and ultimately a pull request for each change.
More, smaller pull requests are easier to debug and merge than fewer large ones, so create pull requests regularly!

.. tip::

More, smaller pull requests are easier to debug and merge than fewer large ones, so please create pull requests regularly!


Steps for working with icepyx locally
Expand Down Expand Up @@ -94,10 +102,10 @@ environment (from the home level of your local copy of the icepyx repo) with

mamba env create --name icepyx-env --channel conda-forge -f requirements-dev.txt -f requirements.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea how easy it is to add the interactive "copy" button to the rendered version of this? Definitely not something we should hold up this PR for, but this caught my eye during review as a spot that would be nice to have.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a pretty easy change with a plugin: https://sphinx-copybutton.readthedocs.io/en/latest/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


and then (1) running `pre-commit install` to let git know about pre-commit and
and then (1) running ``pre-commit install`` to let git know about pre-commit and
(2) pip installing icepyx as described above and below.

One of the tools installed with "requirements-dev.txt" is called [pre-commit](https://pre-commit.com/).
One of the tools installed with "requirements-dev.txt" is called `pre-commit <https://pre-commit.com/>`_.
We have included a set of pre-commit formatting hooks that we strongly encourage all contributors to use.
These hooks will check the files you are committing for format consistency,
reformatting the files if necessary.
Expand Down