Skip to content

Commit

Permalink
Update CONTRIBUTING.rst
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 21, 2016
1 parent bc3558e commit 5d43dff
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 212 deletions.
125 changes: 21 additions & 104 deletions CONTRIBUTING.rst
@@ -1,20 +1,17 @@
==============================
Appendix A. Contribution rules
==============================
:Info: Those are the contribution rules for TEMPLATE.
:Author: Chris Warrick <chris@chriswarrick.com>
:Copyright: © 2015, Chris Warrick.
:License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.)
:Date: 2016-03-03
:Version: 1.3.9
:Info: Those are the contribution rules for Coil CMS.
:Copyright: © 2012-2016, Chris Warrick.
:License: 3-clause BSD

.. index:: contributing

Do you want to contribute to this project? Great! I’d love to see some help,
Do you want to contribute to this project? Great! I’d love to see some help,
but you must comply with some rules.

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL
NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and
NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and
“OPTIONAL” in this document are to be interpreted as described in
RFC 2119.

Expand All @@ -24,13 +21,11 @@ Issue reporting

.. index:: issues

GitHub Issues are the recommended way to report an issue. If you do not have an
account there, get one or mail me.
GitHub Issues are the recommended way to report an issue.

When pasting console sessions, you must paste them fully,
*prompt-to-prompt*, to see all the messages and your input.
Trim only stuff that you are 1000% sure that is not related
to the project in question.
When pasting console sessions, you must paste them fully, *prompt-to-prompt*,
to see all the messages and your input. Trim only stuff that you are 1000%
sure that is not related to the project in question.

--------------------------------------------
General preparations, rules and pull process
Expand All @@ -39,103 +34,25 @@ General preparations, rules and pull process
Prepare
=======

A GitHub account is recommended. Patches by mail are accepted, but working
with you through there is a better way.

Fork the repo first. Non-GitHub people, ``git clone``.

.. _Rules:
A GitHub account is recommended. Patches by e-mail are accepted, but I’d prefer
to work via GitHub.

Rules
=====

1. Commits must have short, informative and logical messages. Signoffs and
long messages are recommended. “fixes #xxx” is required if an issue
1. Commits must have short, informative and logical messages. Signoffs and
long messages are recommended. “Fix #xxx” is required if an issue
exists.
2. The following fancy Unicode characters should be used when
needed: ``— “ ” ‘ ’``
3. The ellipsis (````) character must not be used in program output for
humans, but may be used elsewhere.
4. I’m a Grammar Nazi.
needed: ``— “ ” ‘ ’``. ```` should not appear in console output, but may
appear elsewhere.
3. For Python code, use the PEP 8 coding style and PEP 257 documentation style.
For other languages, K&R style applies. Braces are mandatory in all blocks
(even one-line blocks). Braces are on the same lines as class names and
function signatures. Use 4-space indents.

Request a Pull
==============

Done? Go hit the **Pull Request** button over on GitHub! And if you don’t
use GitHub, ``git format-patch``. Other formats are not accepted.

Your commit should be pulled up in a (longer) while. If I like it. Because
some commits may be bad. So, do your best not to do those bad commits.

---------------------------------------
Details for specific contribution types
---------------------------------------

Code (Python)
=============

1. PEP 8. ``pip install pep8`` is recommended.
2. ``./tests.py``.
3. Localize all the strings (``_('string')``)
4. Strings must be quoted using ``'str'``. Multi-line strings, ``"""str"""``.
Use the latter only if needed. Otherwise, do:

.. code-block:: python
:linenos:
string = ('A very, very, very long string '
'that’s broken up into multiple lines.')
string = _('A very, very, very log string '
'that’s broken up into multiple lines '
'and that is localized through gettext.'))
5. ``str.format``. Braces should be empty or contain a name that is later
passed on to the function. The format function should be inserted *after*
the parenthesis for string localization. For example:

.. code-block:: python
:linenos:
string = _('{} is awesome').format('PKGBUILDer')
string = _('{sth} is awesome').format(sth='PKGBUILDer')
6. Documentation is important. Please take care of it.

Code (non-Python)
=================

Rejected.

Non-code contributions
======================

Those are accepted. No specific rules exist. And don’t remove any files
without my permission (``docs/*.8.gz`` in particular).

Localization
============

.. index:: locale

1. Run ``mkdir -p locale/[CODE]/LC_MESSAGES`` in your terminal, replacing
``[CODE]`` by your language code, as in /usr/share/locale.
2. Copy the ``/messages.pot`` file to
``locale/[CODE]/LC_MESSAGES/[PROJECT].po`` (replace ``[PROJECT]`` with the
project name, all-lowercase)
3. Do your work. The comments will inform you where this string is, and the
ones starting with 'TRANSLATORS:' are for you to read and make use of.
Other comments come from my code and you should not care about them. And
if it is directed for translators, let me know. The Poedit_ app may be
of help. Please take care of the headers at the top of the file (with a
text editor, do not use Poedit for that!) and modify them. The
Last-Translator, Language-Team and Language are important, the others are
auto-generated anyways. The general :ref:`Rules` apply, please take care
of it!
4. Commit (``-s/--signoff`` is required here).
5. Your translation will be added in the next release, or, if a release isn’t
planned in the near future, a new release will be made. Your addition will
be appreciated. Note that I cannot translate new strings, and, as a result,
I might ask you for additions in the future.

.. _Poedit: http://www.poedit.net/
Done? Go hit the **Pull Request** button over on GitHub! Your request should be
accepted shortly (assuming there are no major errors).
125 changes: 21 additions & 104 deletions docs/CONTRIBUTING.rst
@@ -1,20 +1,17 @@
==============================
Appendix A. Contribution rules
==============================
:Info: Those are the contribution rules for TEMPLATE.
:Author: Chris Warrick <chris@chriswarrick.com>
:Copyright: © 2015, Chris Warrick.
:License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.)
:Date: 2016-03-03
:Version: 1.3.9
:Info: Those are the contribution rules for Coil CMS.
:Copyright: © 2012-2016, Chris Warrick.
:License: 3-clause BSD

.. index:: contributing

Do you want to contribute to this project? Great! I’d love to see some help,
Do you want to contribute to this project? Great! I’d love to see some help,
but you must comply with some rules.

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL
NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and
NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and
“OPTIONAL” in this document are to be interpreted as described in
RFC 2119.

Expand All @@ -24,13 +21,11 @@ Issue reporting

.. index:: issues

GitHub Issues are the recommended way to report an issue. If you do not have an
account there, get one or mail me.
GitHub Issues are the recommended way to report an issue.

When pasting console sessions, you must paste them fully,
*prompt-to-prompt*, to see all the messages and your input.
Trim only stuff that you are 1000% sure that is not related
to the project in question.
When pasting console sessions, you must paste them fully, *prompt-to-prompt*,
to see all the messages and your input. Trim only stuff that you are 1000%
sure that is not related to the project in question.

--------------------------------------------
General preparations, rules and pull process
Expand All @@ -39,103 +34,25 @@ General preparations, rules and pull process
Prepare
=======

A GitHub account is recommended. Patches by mail are accepted, but working
with you through there is a better way.

Fork the repo first. Non-GitHub people, ``git clone``.

.. _Rules:
A GitHub account is recommended. Patches by e-mail are accepted, but I’d prefer
to work via GitHub.

Rules
=====

1. Commits must have short, informative and logical messages. Signoffs and
long messages are recommended. “fixes #xxx” is required if an issue
1. Commits must have short, informative and logical messages. Signoffs and
long messages are recommended. “Fix #xxx” is required if an issue
exists.
2. The following fancy Unicode characters should be used when
needed: ``— “ ” ‘ ’``
3. The ellipsis (````) character must not be used in program output for
humans, but may be used elsewhere.
4. I’m a Grammar Nazi.
needed: ``— “ ” ‘ ’``. ```` should not appear in console output, but may
appear elsewhere.
3. For Python code, use the PEP 8 coding style and PEP 257 documentation style.
For other languages, K&R style applies. Braces are mandatory in all blocks
(even one-line blocks). Braces are on the same lines as class names and
function signatures. Use 4-space indents.

Request a Pull
==============

Done? Go hit the **Pull Request** button over on GitHub! And if you don’t
use GitHub, ``git format-patch``. Other formats are not accepted.

Your commit should be pulled up in a (longer) while. If I like it. Because
some commits may be bad. So, do your best not to do those bad commits.

---------------------------------------
Details for specific contribution types
---------------------------------------

Code (Python)
=============

1. PEP 8. ``pip install pep8`` is recommended.
2. ``./tests.py``.
3. Localize all the strings (``_('string')``)
4. Strings must be quoted using ``'str'``. Multi-line strings, ``"""str"""``.
Use the latter only if needed. Otherwise, do:

.. code-block:: python
:linenos:
string = ('A very, very, very long string '
'that’s broken up into multiple lines.')
string = _('A very, very, very log string '
'that’s broken up into multiple lines '
'and that is localized through gettext.'))
5. ``str.format``. Braces should be empty or contain a name that is later
passed on to the function. The format function should be inserted *after*
the parenthesis for string localization. For example:

.. code-block:: python
:linenos:
string = _('{} is awesome').format('PKGBUILDer')
string = _('{sth} is awesome').format(sth='PKGBUILDer')
6. Documentation is important. Please take care of it.

Code (non-Python)
=================

Rejected.

Non-code contributions
======================

Those are accepted. No specific rules exist. And don’t remove any files
without my permission (``docs/*.8.gz`` in particular).

Localization
============

.. index:: locale

1. Run ``mkdir -p locale/[CODE]/LC_MESSAGES`` in your terminal, replacing
``[CODE]`` by your language code, as in /usr/share/locale.
2. Copy the ``/messages.pot`` file to
``locale/[CODE]/LC_MESSAGES/[PROJECT].po`` (replace ``[PROJECT]`` with the
project name, all-lowercase)
3. Do your work. The comments will inform you where this string is, and the
ones starting with 'TRANSLATORS:' are for you to read and make use of.
Other comments come from my code and you should not care about them. And
if it is directed for translators, let me know. The Poedit_ app may be
of help. Please take care of the headers at the top of the file (with a
text editor, do not use Poedit for that!) and modify them. The
Last-Translator, Language-Team and Language are important, the others are
auto-generated anyways. The general :ref:`Rules` apply, please take care
of it!
4. Commit (``-s/--signoff`` is required here).
5. Your translation will be added in the next release, or, if a release isn’t
planned in the near future, a new release will be made. Your addition will
be appreciated. Note that I cannot translate new strings, and, as a result,
I might ask you for additions in the future.

.. _Poedit: http://www.poedit.net/
Done? Go hit the **Pull Request** button over on GitHub! Your request should be
accepted shortly (assuming there are no major errors).
9 changes: 5 additions & 4 deletions release
Expand Up @@ -46,7 +46,8 @@ function error {
}

function cleanup {
rm -rf $PROJECTLC.egg-info **/__pycache__ dist build
rm -rf $PROJECTLC.egg-info build
rm -rf **/__pycache__
}

function cleanup_cmfn {
Expand Down Expand Up @@ -187,17 +188,17 @@ read bailout
./setup.py sdist bdist_wheel
twine upload -s dist/$PROJECTLC-$version.tar.gz dist/$PROJECTLC-$version*.whl

status 'Updating AUR PKGBUILDs...'
[[ -e PKGBUILD ]] && status 'Updating AUR PKGBUILDs...'
[[ -e PKGBUILD ]] && md5out=$(md5sum 'dist/'$PROJECTLC'-'$version'.tar.gz'|awk '{print $1}')
[[ -e PKGBUILD ]] && sed "s/md5sums=.*/md5sums=('$md5out')/" PKGBUILD -i

cleanup

git add -A --ignore-errors .

git commit -asF $cmfn2
git commit -S -asF $cmfn2

git flow release finish $version
git flow release finish -s -m "Version $version" $version
git push
git push --tags

Expand Down

0 comments on commit 5d43dff

Please sign in to comment.