|
Packit Service |
43a081 |
.. _CONTRIBUTING:
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Contributing
|
|
Packit Service |
43a081 |
============
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Thank you for considering contributing to Modules!
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Support questions
|
|
Packit Service |
43a081 |
-----------------
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Please use the `modules-interest mailing list`_ for questions. Do not use the
|
|
Packit Service |
43a081 |
issue tracker for this.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _modules-interest mailing list: https://sourceforge.net/projects/modules/lists/modules-interest
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Asking for new features
|
|
Packit Service |
43a081 |
-----------------------
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Please submit your new feature wishes first to the `modules-interest mailing
|
|
Packit Service |
43a081 |
list`_. Discussion will help to clarify your needs and sometimes the wanted
|
|
Packit Service |
43a081 |
feature may already be available.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Reporting issues
|
|
Packit Service |
43a081 |
----------------
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
* Describe what you expected to happen.
|
|
Packit Service |
43a081 |
* If possible, include a `minimal, complete, and verifiable example`_ to help
|
|
Packit Service |
43a081 |
us identify the issue.
|
|
Packit Service |
43a081 |
* Describe what actually happened. Run the ``module`` command in ``--debug``
|
|
Packit Service |
43a081 |
mode and include all the debug output obtained in your report.
|
|
Packit Service |
43a081 |
* Provide the current configuration and state of your Modules installation by
|
|
Packit Service |
43a081 |
running the ``module config --dump-state`` command.
|
|
Packit Service |
43a081 |
* Provide the name and content of the modulefiles you try to manipulate.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _minimal, complete, and verifiable example: https://stackoverflow.com/help/mcve
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _submitting-patches:
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Submitting patches
|
|
Packit Service |
43a081 |
------------------
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
* Whether your patch is supposed to solve a bug or add a new feature, please
|
|
Packit Service |
43a081 |
include tests. In case of a bug, explain clearly under which circumstances
|
|
Packit Service |
43a081 |
it happens and make sure the test fails without your patch.
|
|
Packit Service |
43a081 |
* If you are not yet familiar with the ``git`` command and `GitHub`_, please
|
|
Packit Service |
43a081 |
read the `don't be afraid to commit`_ tutorial.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _GitHub: https://github.com/
|
|
Packit Service |
43a081 |
.. _don't be afraid to commit: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/index.html
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Start coding
|
|
Packit Service |
43a081 |
~~~~~~~~~~~~
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
* Create a branch to identify the issue or feature you would like to work on
|
|
Packit Service |
43a081 |
* Using your favorite editor, make your changes, `committing as you go`_.
|
|
Packit Service |
43a081 |
* Comply to the `coding conventions of this project <coding-conventions_>`_.
|
|
Packit Service |
43a081 |
* Include tests that cover any code changes you make. Make sure the test fails
|
|
Packit Service |
43a081 |
without your patch.
|
|
Packit Service |
43a081 |
* `Run the tests <running-the-tests_>`_ and `verify coverage <running-test-coverage_>`_.
|
|
Packit Service |
43a081 |
* Push your commits to GitHub and `create a pull request`_.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes
|
|
Packit Service |
43a081 |
.. _create a pull request: https://help.github.com/articles/creating-a-pull-request/
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _running-the-tests:
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Running the tests
|
|
Packit Service |
43a081 |
~~~~~~~~~~~~~~~~~
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Run the basic test suite with::
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
make test
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
This only runs the tests for the current environment. `Travis-CI`_ and
|
|
Packit Service |
43a081 |
`AppVeyor`_ will run the full suite when you submit your pull request.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _Travis-CI: https://travis-ci.org/cea-hpc/modules/
|
|
Packit Service |
43a081 |
.. _AppVeyor: https://ci.appveyor.com/project/xdelaruelle/modules-a6nha
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _running-test-coverage:
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Running test coverage
|
|
Packit Service |
43a081 |
~~~~~~~~~~~~~~~~~~~~~
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Generating a report of lines that do not have test coverage can indicate where
|
|
Packit Service |
43a081 |
to start contributing or what your tests should cover for the code changes you
|
|
Packit Service |
43a081 |
submit.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Run ``make test COVERAGE=y`` which will automatically setup the `Nagelfar`_
|
|
Packit Service |
43a081 |
Tcl code coverage tool in your ``modules`` development directory. Then the
|
|
Packit Service |
43a081 |
full testsuite will be run in coverage mode and a ``modulecmd-test.tcl_m``
|
|
Packit Service |
43a081 |
annotated script will be produced::
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
make test COVERAGE=y
|
|
Packit Service |
43a081 |
# then open modulecmd-test.tcl_m and look for ';# Not covered' lines
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _Nagelfar: http://nagelfar.sourceforge.net/
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Building the docs
|
|
Packit Service |
43a081 |
~~~~~~~~~~~~~~~~~
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Build the docs in the ``doc`` directory using Sphinx::
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
cd doc
|
|
Packit Service |
43a081 |
make html
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Open ``_build/html/index.html`` in your browser to view the docs.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Read more about `Sphinx`_.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _Sphinx: https://www.sphinx-doc.org
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _coding-conventions:
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Coding conventions
|
|
Packit Service |
43a081 |
~~~~~~~~~~~~~~~~~~
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
* Maximum line length is 78 characters
|
|
Packit Service |
43a081 |
* Use 3 spaces to indent code (do not use tab character)
|
|
Packit Service |
43a081 |
* Adopt `Tcl minimal escaping style`_
|
|
Packit Service |
43a081 |
* Procedure names: ``lowerCameCase``
|
|
Packit Service |
43a081 |
* Variable names: ``nocaseatall``
|
|
Packit Service |
43a081 |
* Curly brace and square bracket placement::
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
if {![info exists ::g_already_report]} {
|
|
Packit Service |
43a081 |
set ::g_already_report 1
|
|
Packit Service |
43a081 |
}
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _Tcl minimal escaping style: https://wiki.tcl-lang.org/page/Tcl+Minimal+Escaping+Style
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Emacs settings for coding conventions
|
|
Packit Service |
43a081 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
This is an example emacs configuration that adheres to the first two
|
|
Packit Service |
43a081 |
coding conventions. You may wish to add this to your ``.emacs`` or
|
|
Packit Service |
43a081 |
``.emacs.d/`` to modify your tcl-mode::
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
(add-hook 'tcl-mode-hook
|
|
Packit Service |
43a081 |
(lambda ()
|
|
Packit Service |
43a081 |
(setq indent-tabs-mode nil)
|
|
Packit Service |
43a081 |
(setq tcl-indent-level 3)
|
|
Packit Service |
43a081 |
(setq tcl-continued-indent-level 3)
|
|
Packit Service |
43a081 |
(font-lock-add-keywords nil '(("^[^\n]\\{79\\}\\(.*\\)$" 1
|
|
Packit Service |
43a081 |
font-lock-warning-face prepend)))))
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
Submitting installation recipes
|
|
Packit Service |
43a081 |
-------------------------------
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
* If you want to share your installation tips and tricks, efficient ways you
|
|
Packit Service |
43a081 |
have to write or organize your modulefiles or some extension you made to the
|
|
Packit Service |
43a081 |
``module`` command please add a recipe to the cookbook section of the
|
|
Packit Service |
43a081 |
documentation.
|
|
Packit Service |
43a081 |
* Create a directory under ``doc/example`` and put there the extension code
|
|
Packit Service |
43a081 |
or example modulefiles your recipe is about.
|
|
Packit Service |
43a081 |
* Describe this recipe through a `reStructuredText`_ document in
|
|
Packit Service |
43a081 |
``doc/source/cookbook``. It is suggested to have an *Implementation*,
|
|
Packit Service |
43a081 |
an *Installation* and an *Usage example* sections in that document to get
|
|
Packit Service |
43a081 |
as much as possible the same document layout across recipes.
|
|
Packit Service |
43a081 |
* `Submit a patch <submitting-patches_>`_ with all the above content.
|
|
Packit Service |
43a081 |
|
|
Packit Service |
43a081 |
.. _reStructuredText: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
|
|
Packit Service |
43a081 |
|