Skip to content

Commit

Permalink
Add section on commit messages to coding style
Browse files Browse the repository at this point in the history
Also enables the table of contents for easier navigation. Adds an
explicit header ID to be able to reference it later. Both changes
could cause trouble in earlier versions of Doxygen. Tested with
version 1.8.20.

Signed-off-by: Daniel Sieger <[email protected]>
  • Loading branch information
dsieger committed Dec 15, 2020
1 parent c9ca80f commit a876af6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/codingstyle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Coding Style {#codingstyle}

[TOC]

This section describes some of the coding standards that are being used in the
pmp-library source tree. Although these standards should never be regarded as
strict requirements they are still important to establish a minimum level of
Expand Down Expand Up @@ -289,6 +291,38 @@ m(3, 0) = 0.0; m(3, 1) = 0.0; m(3, 2) = 0.0; m(3, 3) = 1.0;
// clang-format on
```
## Commit Messages {#commit-messages}
Please write meaningful commit messages. See [this post](https://chris.beams.io/posts/git-commit/) for the why and how.
The basic rules are:
1. Separate subject from body with a blank line
2. Limit the subject line to 50 characters
3. Capitalize the subject line
4. Do not end the subject line with a period
5. Use the imperative mood in the subject line
6. Wrap the body at 72 characters
7. Use the body to explain what and why vs. how
This is what an example might look like:
```text
Summarize changes in around 50 characters or less
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. Explain the problem this commit is solving.
Focus on why you are making this change as opposed to how. Are there
any side effects or counter-intuitive consequences?
Reference issues at the bottom, sign off on last line:
Resolves: #123
See also: #456, #789
Sign-off-by: Jane Miller <[email protected]>
```

## See Also

The above coding standard is necessarily incomplete. Therefore, we list some
Expand Down

0 comments on commit a876af6

Please sign in to comment.