Remove cycle suppression
[gromacs.git] / docs / dev-manual / tools.rst
blob77c60d3f8894f1f841d2c2ba8eb4145ca6b23475
1 Development-time tools
2 ======================
4 Several tools have their own individual pages and are listed below.
6 .. toctree::
7    :maxdepth: 2
9    doxygen
10    jenkins
11    releng/index
12    gmxtree
13    uncrustify
14    testutils
16 .. TODO: Consider what is the most reasonable structure; currently, this list
17    here does not make much sense in the overall organization and creates a
18    confusing TOC for the developer guide.
20 .. TODO: Add details for most of the tools, either in the form of links to wiki,
21    or to a separate page that explains more details.
23 Change management
24 -----------------
26 git
27   |Gromacs| uses `git<https://git-scm.com/>` as the version control system.
28   Instructions for setting up git for |Gromacs|, as well as tips and tricks for
29   its use, can be found on the wiki: `Git Tips & Tricks`_
31   Other basic tutorial material for ``git`` can be found on the `web<https://git-scm.com/doc/ext>`.
33 Gerrit
34   All code changes go through a code review system at
35   http://gerrit.gromacs.org.
37 Jenkins
38   All changes pushed to Gerrit are automatically compiled and otherwise
39   checked on various platforms using a continuous integration system at
40   http://jenkins.gromacs.org.
41   :doc:`jenkins` documents how Jenkins interacts with the build system,
42   providing information on how to replicate the builds Jenkins does (e.g., to
43   diagnose issues).
44   :doc:`releng/index` provides more information on the technical implementation
45   of the builds.
47 Redmine
48   Bugs and issues, as well as some random features and discussions,
49   are tracked at http://redmine.gromacs.org.
51 .. _Git Tips & Tricks: http://www.gromacs.org/index.php?title=Developer_Zone/Git/Git_Tips_%26_Tricks
53 Build system
54 ------------
56 .. TODO: details, ASAN, others?
58 CMake
59   Main tool used in the build system.
61 packaging for distribution (CPack)
63 unit testing (CTest)
64   |Gromacs| uses a unit testing framework based on Google C++ Testing
65   Framework (gtest) and CTest.  All unit tests are automatically run on Jenkins
66   for each commit.
67   Details can be found on a separate page on :doc:`testutils`.
69 regression tests
71 cppcheck
72   `cppcheck <http://cppcheck.sourceforge.net>`_ is used for static code
73   analysis, and is run automatically on Jenkins for each commit.  Different rules
74   are used for C and C++ code (with stricter checking for C++ code, as that is
75   newer).  The build system provides a ``cppcheck`` target (produced from
76   ``tests/CppCheck.cmake``) to run the tool.  This target is used also by Jenkins.
78 clang static analyzer
80 coverage
82 .. _dev-formatting-tools:
84 Code formatting and style
85 -------------------------
87 The tools and scripts listed below are used to automatically check/apply
88 formatting that follows |Gromacs| style guidelines described on a separate page:
89 :doc:`style`.
91 uncrustify
92   `uncrustify <http://uncrustify.sourceforge.net>`_ is used for automatic
93   indentation and other formatting of the source code to follow
94   :doc:`formatting`.  All code must remain invariant under uncrustify
95   with the config at ``admin/uncrustify.cfg``.  A patched version of uncrustify is
96   used.  See :doc:`uncrustify` for details.
98 ``admin/copyright.py``
99   This Python script adds and formats copyright headers in source files.
100   ``uncrustify.sh`` (see below) uses the script to check/update copyright years on
101   changed files automatically.
103 ``admin/uncrustify.sh``
104   This ``bash`` script runs uncrustify and ``copyright.py`` for all
105   files that have local changes and checks that they conform to the prescribed
106   style.  Optionally, the script can also apply changes to make the files
107   conform.
108   This script is automatically run by Jenkins to ensure that all commits adhere
109   to :doc:`formatting`.  If the uncrustify job does not succeed, it
110   means that this script has something to complain.
111   See :doc:`uncrustify` for details.
113 ``admin/git-pre-commit``
114   This sample git pre-commit hook can be used if one wants to apply
115   ``uncrustify.sh`` automatically before every commit to check for formatting
116   issues.  See :doc:`uncrustify` for details.
118 ``docs/doxygen/includesorter.py``
119   This Python script sorts and reformats #include directives according to
120   the guidelines at :doc:`includestyle`.  Details are documented on a
121   separate page (with the whole suite of Python scripts used for source code
122   checks): :ref:`dev-include-sorter`.
124 include directive checker
125   In its present form, the above include sorter script cannot be conveniently
126   applied in ``uncrustify.sh``.  To check for issues, it is instead integrated into
127   a ``check-source`` build target.  When this target is built, it also checks for
128   include formatting issues.  Internally, it uses the sorter script.  This check
129   is run in Jenkins as part of the Documentation job.
130   Details for the checking mechanism are on a separate page (common for several
131   checkers): :doc:`gmxtree`.
133 ``admin/reformat_all.sh``
134   This ``bash`` script runs uncrustify/``copyright.py``/include sorter
135   on all relevant files in the source tree (or in a particular directory).
136   The script can also produce the list of files where these scripts are applied,
137   for use with other scripts.  See :doc:`uncrustify` for details.
139 git attributes
140   git attributes (specified in ``.gitattributes`` files) are used to annotate
141   which files are subject to automatic formatting checks (and for automatic
142   reformatting by the above scripts).  See ``man gitattributes`` for an overview of
143   the mechanism.  We use the ``filter`` attribute to specify the type of automatic
144   checking/formatting to apply.  Custom attributes are used for specifying some
145   build system dependencies for easier processing in CMake.
147 include-what-you-use