Skip to content

Reformat code with clang-format v11

Chris Cantwell requested to merge tidy/reformat-code into master

Issue/feature addressed

The formatting of the code is inconsistent and does not comply with the documented coding guidelines. The formatting of new additions or modifications is challenging as it is desirable to have consistent formatting within a file, yet different files follow different styles. This therefore prevents us transitioning to a well-defined coding standard.

Proposed solution

Reformat the whole library in one go and require new merge requests to also complete code formatting on the library.


The code was reformatted using clang-format v11. A new CI job has been added to verify that the code format is compliant (i.e. no further changes are proposed by running clang-format on it).


Not applicable.


There is a potential risk that different versions of clang-format will lead to slightly different formatting. We may need to revisit this if it causes an issue.


  • Functions and classes, or changes to them, are documented.
  • User guide/documentation is updated.
  • Changelog is updated.
  • Suitable tests added for new functionality.
  • Newly added files are correctly formatted.
  • License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).
Edited by Chris Cantwell

Merge request reports