Skip to content

Commit 278038f

Browse files
committed
documentation: update contributing guide
Co-Authored-by: Pascal Repond <[email protected]>
1 parent 5b421bc commit 278038f

File tree

1 file changed

+57
-52
lines changed

1 file changed

+57
-52
lines changed

Diff for: CONTRIBUTING.rst

+57-52
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
..
22
RERO ILS
3-
Copyright (C) 2019 RERO
3+
Copyright (C) 2019-2022 RERO+
44
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU Affero General Public License as published by
@@ -24,13 +24,13 @@ little bit helps, and credit will always be given.
2424
Types of Contributions
2525
----------------------
2626

27-
Security Reports
28-
~~~~~~~~~~~~~~~~~
27+
Security reports
28+
~~~~~~~~~~~~~~~~
2929

3030
In case you identified a security issue on the project, please report it to the
3131
e-mail address given in the `security policy`_.
3232

33-
Report Bugs
33+
Bug reports
3434
~~~~~~~~~~~
3535

3636
Report bugs at https://github.com/rero/rero-ils/issues.
@@ -41,8 +41,8 @@ If you are reporting a bug, please include:
4141
* Any details about your local setup that might be helpful in troubleshooting.
4242
* Detailed steps to reproduce the bug.
4343

44-
Fix Bugs
45-
~~~~~~~~
44+
Bug fixes
45+
~~~~~~~~~
4646

4747
Look through the GitHub issues for bugs. Anything tagged with "bug"
4848
is open to whoever wants to implement it.
@@ -76,71 +76,76 @@ If you are proposing a feature:
7676
Get Started!
7777
------------
7878

79-
Ready to contribute? Here's how to set up ``rero-ils`` for local development.
79+
Ready to contribute? See the `installation procedure`_ to setup a local
80+
development environment.
8081

81-
1. Fork the ``rero/rero-ils`` repo on GitHub.
82-
2. Clone your fork locally:
8382

84-
.. code-block:: console
8583

86-
$ git clone [email protected]:your_name_here/rero-ils.git
87-
88-
3. Install your local using the `installation procedure`_.
89-
90-
4. Create a branch for local development:
91-
92-
.. code-block:: console
93-
94-
$ git checkout -b name-of-your-bugfix-or-feature
95-
96-
Now you can make your changes locally.
97-
98-
5. When you're done making changes, check that your changes pass tests:
84+
Pull Request Guidelines
85+
-----------------------
9986

100-
.. code-block:: console
87+
Before you submit a pull request, check that it meets these guidelines:
10188

102-
$ ./run-tests.sh
89+
1. The pull request should include tests and should not decrease test coverage.
90+
2. Your code is as clear as possible and sufficiently documented (comments,
91+
docstrings, ...).
92+
3. All tests on GitHub Actions should pass before merging.
10393

104-
The tests will provide you with test coverage and also check PEP8
105-
(code style), PEP257 (documentation), flake8 as well as build the Sphinx
106-
documentation and run doctests.
94+
Commit message style
95+
~~~~~~~~~~~~~~~~~~~~
10796

108-
6. Add the ``.gitmessage.txt`` file to your ``git`` configuration:
97+
Your commit message should follow Invenio's `style guide`_. Commit message is first and foremost about the content. You are communicating
98+
with fellow developers, so be clear and brief.
10999

110-
.. code-block:: console
100+
(Inspired by `How to Write a Git Commit Message
101+
<https://chris.beams.io/posts/git-commit/>`_)
111102

112-
# globally
113-
$ git config --global commit.template /path/.gitmessage.txt
103+
1. `Separate subject from body with a blank line.
104+
<https://chris.beams.io/posts/git-commit/#separate>`_
105+
2. `Limit the subject line to 50 characters.
106+
<https://chris.beams.io/posts/git-commit/#limit-50>`_
107+
3. Indicate the component followed by a short description
108+
4. `Do not end the subject line with a period.
109+
<https://chris.beams.io/posts/git-commit/#end>`_
110+
5. `Use the imperative mood in the subject line.
111+
<https://chris.beams.io/posts/git-commit/#imperative>`_
112+
6. `Wrap the body at 72 characters.
113+
<https://chris.beams.io/posts/git-commit/#wrap-72>`_
114+
7. `Use the body to explain what and why vs. how, using bullet points. <https://chris.beams.io/posts/git-commit/#why-not-how>`_
114115

115-
# locally
116-
$ git config --local commit.template .gitmessage.txt
116+
For example::
117117

118-
The ``Signed-off-by`` message is not used anymore, so you can avoid ``-s``
119-
parameters when committing. But of course, you can modify your own version
120-
of the ``.gitcommit.txt`` in order to add you own ``Co-Authored-by`` message.
118+
component: summarize changes in 50 char or less
121119

122-
7. Commit your changes and push your branch to GitHub:
120+
* More detailed explanatory text, if necessary. Formatted using
121+
bullet points, preferably `*`. Wrapped to 72 characters.
123122

124-
.. code-block:: console
123+
* Explain the problem that this commit is solving. Focus on why you
124+
are making this change as opposed to how (the code explains that).
125+
Are there side effects or other unintuitive consequences of this
126+
change? Here's the place to explain them.
125127

126-
$ git add .
127-
$ git commit -s
128-
$ git push origin name-of-your-bugfix-or-feature
128+
* Data Migration Instructions: if your PR makes changes to the data model
129+
or needs an action when updating an existing instance, include
130+
migration instructions (e.g. needs item reindexing, needs update mapping).
131+
It is even better if you can also include an Alembic script directly in
132+
your PR.
129133

130-
8. Submit a pull request through the GitHub website.
134+
* Use words like "Adds", "Fixes" or "Breaks" in the listed bullets to help
135+
others understand what you did.
131136

132-
Pull Request Guidelines
133-
-----------------------
137+
* If your commit closes or addresses an issue in the same project, you can
138+
mention it in any of the bullets after the dot (closes #XXX). If it
139+
addresses an issue from another project, mention the full issue URL
140+
(Closes https://github.com/rero/rero-ils/issues/XXX).
134141

135-
Before you submit a pull request, check that it meets these guidelines:
142+
Co-authored-by: John Doe <[email protected]>
136143

137-
1. The pull request should include tests and must not decrease test coverage.
138-
2. If the pull request adds functionality, the docs should be updated. Put
139-
your new functionality into a function with a docstring.
140-
3. The pull request should work for Python 2.7, 3.3, 3.4 and 3.5. Check
141-
https://travis-ci.org/rero/rero-ils/pull_requests
142-
and make sure that the tests pass for all supported Python versions.
144+
**Git signature:** The only signature we use is ``Co-authored-by`` (see above)
145+
to provide credit to co-authors. Previously we required a ``Signed-off-by``
146+
signature, however this is no longer required.
143147

144148
.. References:
145149
.. _installation procedure: INSTALL.rst
146150
.. _security policy: SECURITY.rst
151+
.. _style guide: https://github.com/inveniosoftware/invenio/blob/master/CONTRIBUTING.rst#commit-messages

0 commit comments

Comments
 (0)