@@ -49,7 +49,6 @@ read it carefully.
4949 - [ Testing your code] ( #testing-your-code )
5050 - [ Testing plots] ( #testing-plots )
5151 - [ Documentation] ( #documentation )
52- - [ Code Review] ( #code-review )
5352
5453
5554## What Can I Do?
@@ -205,36 +204,73 @@ hesitate to [ask questions](#how-can-i-talk-to-you)):
205204
206205### General guidelines
207206
208- We follow the [ git pull request workflow] ( http://www.asmeurer.com/git-workflow/ ) to
209- make changes to our codebase.
207+ We follow the [ git pull request workflow] ( http://www.asmeurer.com/git-workflow )
208+ to make changes to our codebase.
210209Every change made goes through a pull request, even our own, so that our
211- [ continuous integration] ( https://en.wikipedia.org/wiki/Continuous_integration ) services
212- have a change to check that the code is up to standards and passes all our tests.
210+ [ continuous integration] ( https://en.wikipedia.org/wiki/Continuous_integration )
211+ services have a chance to check that the code is up to standards and passes all
212+ our tests.
213213This way, the * master* branch is always stable.
214214
215- General guidelines for pull requests (PRs):
216-
217- * ** Open an issue first** describing what you want to do. If there is already an issue
218- that matches your PR, leave a comment there instead to let us know what you plan to
219- do.
220- * Each pull request should consist of a ** small** and logical collection of changes.
221- * Larger changes should be broken down into smaller components and integrated
222- separately. For example, break the wrapping of aliases into multiple pull requests.
223- * Bug fixes should be submitted in separate PRs.
224- * Use underscores for all Python (* .py) files as per [ PEP8] ( https://www.python.org/dev/peps/pep-0008/ ) ,
225- not hyphens. Directory names should also use underscores instead of hyphens.
226- * Describe what your PR changes and * why* this is a good thing. Be as specific as you
227- can. The PR description is how we keep track of the changes made to the project over
228- time.
229- * Do not commit changes to files that are irrelevant to your feature or bugfix (eg:
230- ` .gitignore ` , IDE project files, etc).
231- * Write descriptive commit messages. Chris Beams has written a
232- [ guide] ( https://chris.beams.io/posts/git-commit/ ) on how to write good commit
233- messages.
234- * Be willing to accept criticism and work on improving your code; we don't want to break
235- other users' code, so care must be taken not to introduce bugs.
236- * Be aware that the pull request review process is not immediate, and is generally
237- proportional to the size of the pull request.
215+ General guidelines for making a Pull Request (PR):
216+
217+ * What should be included in a PR
218+ - Have a quick look at the titles of all the existing issues first. If there
219+ is already an issue that matches your PR, leave a comment there to let us
220+ know what you plan to do. Otherwise, ** open an issue** describing what you
221+ want to do.
222+ - Each pull request should consist of a ** small** and logical collection of
223+ changes; larger changes should be broken down into smaller parts and
224+ integrated separately.
225+ - Bug fixes should be submitted in separate PRs.
226+ * How to write and submit a PR
227+ - Use underscores for all Python (* .py) files as per
228+ [ PEP8] ( https://www.python.org/dev/peps/pep-0008/ ) , not hyphens. Directory
229+ names should also use underscores instead of hyphens.
230+ - Describe what your PR changes and * why* this is a good thing. Be as
231+ specific as you can. The PR description is how we keep track of the changes
232+ made to the project over time.
233+ - Do not commit changes to files that are irrelevant to your feature or
234+ bugfix (e.g.: ` .gitignore ` , IDE project files, etc).
235+ - Write descriptive commit messages. Chris Beams has written a
236+ [ guide] ( https://chris.beams.io/posts/git-commit/ ) on how to write good
237+ commit messages.
238+ * PR review
239+ - Be willing to accept criticism and work on improving your code; we don't
240+ want to break other users' code, so care must be taken not to introduce
241+ bugs.
242+ - Be aware that the pull request review process is not immediate, and is
243+ generally proportional to the size of the pull request.
244+
245+ #### Code Review
246+
247+ After you've submitted a pull request, you should expect to hear at least a
248+ comment within a couple of days. We may suggest some changes, improvements or
249+ alternative implementation details.
250+
251+ To increase the chances of getting your pull request accepted quickly, try to:
252+
253+ * Submit a friendly PR
254+ - Write a good and detailed description of what the PR does.
255+ - Write some documentation for your code (docstrings) and leave comments
256+ explaining the * reason* behind non-obvious things.
257+ - Write tests for the code you wrote/modified if needed.
258+ Please refer to [ Testing your code] ( #testing-your-code ) or
259+ [ Testing plots] ( #testing-plots ) .
260+ - Include an example of new features in the gallery or tutorials.
261+ Please refer to [ Gallery plots] ( #gallery-plots ) or [ Tutorials] ( #tutorials ) .
262+ * Have a good coding style
263+ - Use readable code, as it is better than clever code (even with comments).
264+ - Follow the [ PEP8] ( http://pep8.org ) style guide for code and the
265+ [ numpy style guide] ( https://numpydoc.readthedocs.io/en/latest/format.html )
266+ for docstrings. Please refer to [ Code style] ( #code-style ) .
267+
268+ Pull requests will automatically have tests run by GitHub Actions.
269+ This includes running both the unit tests as well as code linters.
270+ GitHub will show the status of these checks on the pull request.
271+ Try to get them all passing (green).
272+ If you have any trouble, leave a comment in the PR or
273+ [ get in touch] ( #how-can-i-talk-to-you ) .
238274
239275### Setting up your environment
240276
@@ -510,11 +546,17 @@ def test_my_plotting_case():
510546
511547### Documentation
512548
549+ Most documentation sources are in Python ` *.py ` files under the ` examples/ `
550+ folder, and the code docstrings can be found e.g. under the ` pygmt/src/ ` and
551+ ` pygmt/datasets/ ` folders. The documentation are written in
552+ [ reStructuredText] ( https://docutils.sourceforge.io/rst.html ) and
553+ built by [ Sphinx] ( http://www.sphinx-doc.org/ ) . Please refer to
554+ [ reStructuredText Cheatsheet] ( https://docs.generic-mapping-tools.org/latest/rst-cheatsheet.html )
555+ if you are new to reStructuredText.
556+
513557#### Building the documentation
514558
515- Most documentation sources are in the ` doc ` folder.
516- We use [ sphinx] ( http://www.sphinx-doc.org/ ) to build the web pages from these sources.
517- To build the HTML files:
559+ To build the HTML files from sources:
518560
519561``` bash
520562cd doc
@@ -560,33 +602,3 @@ https://docs.generic-mapping-tools.org/latest/gmt.conf.html#term-COLOR_FOREGROUN
560602
561603Sphinx will create a link to the automatically generated page for that
562604function/class/module.
563-
564- ** All docstrings** should follow the
565- [ numpy style guide] ( https://numpydoc.readthedocs.io/en/latest/format.html ) .
566- All functions/classes/methods should have docstrings with a full description of all
567- arguments and return values.
568-
569- ### Code Review
570-
571- After you've submitted a pull request, you should expect to hear at least a comment
572- within a couple of days.
573- We may suggest some changes or improvements or alternatives.
574-
575- Some things that will increase the chance that your pull request is accepted quickly:
576-
577- * Write a good and detailed description of what the PR does.
578- * Write tests for the code you wrote/modified.
579- * Readable code is better than clever code (even with comments).
580- * Write documentation for your code (docstrings) and leave comments explaining the
581- * reason* behind non-obvious things.
582- * Include an example of new features in the gallery or tutorials.
583- * Follow the [ PEP8] ( http://pep8.org ) style guide for code and the
584- [ numpy guide] ( https://numpydoc.readthedocs.io/en/latest/format.html )
585- for documentation.
586-
587- Pull requests will automatically have tests run by GitHub Actions.
588- This includes running both the unit tests as well as code linters.
589- GitHub will show the status of these checks on the pull request.
590- Try to get them all passing (green).
591- If you have any trouble, leave a comment in the PR or
592- [ get in touch] ( #how-can-i-talk-to-you ) .
0 commit comments