A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
check Namespace Reference

-style-clang-format More...

Detailed Description

-style-clang-format

Check and apply the ns-3 coding style recursively to all files in the PATH arguments.

The coding style is defined with the clang-format tool, whose definitions are in
the ".clang-format" file. This script performs the following checks / fixes:
- Check / apply clang-format. Respects clang-format guards.
- Check / fix local #include headers with "ns3/" prefix. Respects clang-format guards.
- Check / fix ns-3 #include headers using angle brackets <> rather than quotes "". Respects clang-format guards.
- Check / fix Doxygen tags using @ rather than \\. Respects clang-format guards.
- Check / fix SPDX licenses rather than GPL text. Respects clang-format guards.
- Check / fix emacs file style comments. Respects clang-format guards.
- Check / trim trailing whitespace. Always checked.
- Check / replace tabs with spaces. Respects clang-format guards.
- Check file encoding. Always checked.

This script can be applied to all text files in a given path or to individual files.

NOTE: The formatting check requires clang-format to be found on the path (see the supported versions below).
The remaining checks do not depend on clang-format and can be executed by disabling clang-format
checking with the "--no-formatting" option.