Skip to content

Conformance

Kelly Ledford edited this page Nov 15, 2018 · 8 revisions

Conformance Scripts and Commit Messages

Cppcheck

First ensure that cppcheck is installed on your system -- to install cppcheck on ubuntu sudo apt install cppcheck

To run: cppcheck -i <directory or filename>

For more information view the cppcheck man page

clang-format

Ensures that your change conforms with our C++ style guide.

Prior to committing your changes:

Running the following commands before commit will show you if any changes are needed:

git diff | clang-format-diff-3.9 -p 1 -style=file

If you are happy with the changes, running the following command will apply them:

git diff | clang-format-diff-3.9 -p 1 -style=file -i

If you have already committed the code, you can run:

git show HEAD | clang-format-diff-3.9 -p 1 -style=file -i

This will change the coding style of the top commit. Note: This will not commit the changes made. You can view the changes by running:

git diff

The changes then must be committed. You can add them to your top commit by running:

git commit --amend -sa

Commit messages

Commit messages should follow the format guidelines outlined below. Note: Jira: -> Tracked-On: & Change-Id: are recent additions to the requirements

commit message expected format:

A title for the patch (<50 characters)

Detailed description

Change-Id: (gerrit change id # -- may be left blank)
Tracked-On: (direct link to JIRA issue) and / or (direct link to Github PR#)
Test: (what tests are expected to pass)
Signed-off-by: (Author name & author email address)

commit message sample:

Fix main transporters

Realignment of the pattern buffers, ensuring that transported
biological matter materializes in the correct sequence.

Change-Id: 12345678987654321
Tracked-On: Jira - NCC-1701 & Github - #1701
Tests: Successful transport of tribbles
Signed-off-by: Montgomery Scott <scotty@federation.com>

In addition, in the case that the commit is a work around for a known issue which needs more time to be properly fixed, the commit should have the following title: REVERTME: Summary of the workaround