Skip to content

Commit a4c49f9

Browse files
add doc on clang-format process
1 parent 6377c74 commit a4c49f9

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,25 @@ This is our recommended process. If it sounds too daunting, ask for help.
2929
3. Create a branch in your fork with a descriptive name and put your fixes there. If your fix is
3030
simple you could do it on github by editing a file, otherwise clone your project (or add a remote
3131
to your current git clone) and work as usual.
32-
4. If your change is important, add it to the release notesfor the upcoming version, [see](https://github.com/UCL/STIR/blob/master/documentation/)
32+
4. Configure your editor and potentially even [pre-commit](https://pre-commit.com/), see
33+
[documentation/devel/README.md](documentation/devel/README.md).
34+
5. If your change is important, add it to the release notes for the upcoming version in the [documentation folder](https://github.com/UCL/STIR/tree/master/documentation/)
3335
and even the [User's Guide](https://github.com/UCL/STIR/blob/master/documentation/STIR-UsersGuide.tex) or other documentation files.
34-
5. Use [well-formed commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
36+
6. Use [well-formed commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
3537
for each change (in particular with a single "subject" line
36-
followed by an empty line and then more details). If the change affects comments only, it is recommended to put `[ci skip]` in your subject line. This avoids unnecessary computation, and clogging our Travis/Appveyor queues.
37-
6. Push the commits to your fork and submit a [pull request (PR)](https://help.github.com/articles/creating-a-pull-request)
38-
(enable changes by project admins.) Give your pull request a descriptive name (i.e. don't call if *Fix #issuenumber*. Be prepared to add further commits to your branch after discussion.
39-
In the description of the PR, add a statement about which Issue this applies to
40-
using [a phrase such that github auto-closes the issue when merged to master](https://help.github.com/articles/closing-issues-using-keywords/).
41-
7. Be prepared to add further commits to your branch after discussion.
38+
followed by an empty line and then more details).
4239
Please by mindful about the resources used by our Continuous Integration (CI) workflows:
4340
- Group your commits and only push once your code compiles and tests succeed on your machine (ideally you have sensible commit messages at every stage)
4441
- Use specific keywords in the first line of the last commit that you push to prevent CI being run:
4542
- `[ci skip]` skips all CI runs (e.g. when you only change documentation, or when your update isn't ready yet)
4643
- `[actions skip]` does not run GitHub Actions, see [here](https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/). Note: this can be in the main commit message.
4744
- `[skip appveyor]` does not run Appveyor, see [here](https://www.appveyor.com/docs/how-to/filtering-commits/#skip-directive-in-commit-message)
48-
8. After acceptance of your PR, go home with a nice warm feeling.
45+
7. Push the commits to your fork and submit a [pull request (PR)](https://help.github.com/articles/creating-a-pull-request)
46+
(enable changes by project admins.) Give your pull request a descriptive name (i.e. don't call if *Fix #issuenumber*. Be prepared to add further commits to your branch after discussion.
47+
In the description of the PR, add a statement about which Issue this applies to
48+
using [a phrase such that github auto-closes the issue when merged to master](https://help.github.com/articles/closing-issues-using-keywords/).
49+
8. Be prepared to add further commits to your branch after discussion.
50+
9. After acceptance of your PR, go home with a nice warm feeling.
4951

5052
Suggested reading:
5153
https://help.github.com/articles/fork-a-repo/, https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project or https://guides.github.com/activities/forking/.

documentation/STIR-developers-overview.tex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,10 @@ \section{
13311331

13321332
\section{Contributing to STIR}
13331333
See
1334-
\R2Lurl{https://github.com/UCL/STIR/blob/master/CONTRIBUTING.md}{STIR/CONTRIBUTING.md}.
1334+
\R2Lurl{https://github.com/UCL/STIR/blob/master/CONTRIBUTING.md}{STIR/CONTRIBUTING.md}
1335+
and
1336+
\R2Lurl{https://github.com/UCL/STIR/blob/master/documentation/devel/README.md}{documentation/devel/README.md}
1337+
for more information on editor settings etc.
13351338

13361339
\subsection{Continuous integration testing}
13371340
We use GitHub Actions and Appveyor for testing of every pull-request that was submitted on GitHub. PRs

documentation/release_6.0.htm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1>Summary of changes in STIR release 6.0</h1>
99

1010
<p>This version is 99% backwards compatible with STIR 5.x for the user (see below).
1111
Developers might need to make code changes as
12-
detailed below. Note though that the location of installed files have changed.
12+
detailed below. Note though that the <strong>locations of installed files have changed</strong>.
1313
Developers of other software that uses STIR via CMake will need to adapt (see below).
1414
</p>
1515
<h2>Overall summary</h2>
@@ -285,6 +285,18 @@ <h2>New deprecations for future versions</h2>
285285
<H2>What's new for developers (aside from what should be obvious
286286
from the above):</H2>
287287

288+
<h3>White-space and style enforcement</h3>
289+
<ul>
290+
<li>We now use <tt>clang-format</tt> to enforce C++-style, including white-space settings, line-breaks
291+
etc. This uses the <tt>.clang-format</tt> file in the root directory of STIR. Developers should
292+
configure their editor encordingly, and ideally use <tt>pre-commit</tt>. It also has
293+
consequences for existing branches as you might experience more conflicts than usual
294+
during a merge. More detail is in
295+
<a href="https://github.com/UCL/STIR/blob/master/documentation/devel/README.md">documentation/devel/README.md</a>.<br>
296+
<a href="https://github.com/UCL/STIR/pull/1368">PR #1368</a>.
297+
</li>
298+
</ul>
299+
288300
<h3>Backward incompatibities</h3>
289301
<ul>
290302
<li>

0 commit comments

Comments
 (0)