Skip to content

Commit

Permalink
Update developer's guide
Browse files Browse the repository at this point in the history
  • Loading branch information
gipert committed Dec 19, 2024
1 parent b90a7c9 commit 4c4401c
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Developer's guide

```{admonition} TL;DR / check list
Before opening a PR:
- make sure to follow our code style conventions
- run pre-commit and fix all the issues
- add documentation, either as code docstrings or as manual pages
- if unsure about the docs format, build the documentation and check the result
- add tests for your new feature
- run tests and check if they all pass
- if adding a new macro command, update the macro command reference page
- prepare a coherent and tidy commit history (with e.g. `git rebase -i`)
After the CI has run:
- fix all reported problems, if any
- navigate to the ReadTheDocs documentation build (linked in the GitHub
actions report for the PR) and check that the docs are properly rendered
- download and check the test outputs from the GitHub actions interface
```

The following rules and conventions have been established for the package
development and are enforced throughout the entire code base. Merge requests
that do not comply to the following directives will be rejected.
Expand Down Expand Up @@ -67,10 +87,11 @@ $ make
$ ctest
```

:::{note}
Some tests are known to be flaky, especially with older Geant4 version
branches.
:::
If tests produce output files with an extension that contains an `.output`
sub-extension, they will be automatically uploaded to GitHub as part of a
tarball. This can be downloaded and inspected from the GitHub actions run page:
navigate to "Actions", select the CI run of interest, scroll to the bottom of
the page.

Cheatsheet:
```console
Expand All @@ -79,11 +100,6 @@ $ ctest -L vis # run only tests with label "vis"
$ ctest -R basics-mt/print-volumes.mac # run only this test
```

`vis` tests are currently not run in CI, since there is no graphical
environment available. Moreover, they won't be marked as "failed" (but rather
"skipped") if they fail due to the same reason. In case you want to run them
locally, make sure there is support for graphics.

If you want to open a fanci UI to check the output of `vis` tests, you may
achieve it by:

Expand All @@ -104,10 +120,16 @@ following:
GitHub/LEGEND wiki pages should be written.
- Pull request authors are required to provide sufficient documentation for
every proposed change or addition.
- Documentation for classes/methods etc. should be provided in the same source
file, as Doxygen-formatted comments (see e.g. [this
guide](https://www.doxygen.nl/manual/docblocks.html)). They will be
automatically added to the API documentation section on ReadTheDocs.
- General guides, comprehensive tutorials or other high-level documentation
(e.g. referring to how separate parts of the code interact between each
other) must be provided as separate pages in `docs/` and linked in the
table of contents.
table of contents. These documentation source files must formatted in
reStructuredText (reST). A reference format specification is available on the
[Sphinx reST usage guide](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html).

To generate documentation locally, run

Expand All @@ -121,12 +143,6 @@ You'll need a Doxygen installation and Python software dependencies specified
in `docs/environment.yml`. The generated documentation can be viewed by
pointing your browser to `docs/_build/index.html`.

### Writing documentation

Documentation source files must formatted in reStructuredText (reST). A
reference format specification is available on the [Sphinx reST usage
guide](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html).

### Automatic command reference generation

If you change the Geant macro command-based interface in a pull request, please
Expand Down

0 comments on commit 4c4401c

Please sign in to comment.