Closes #37. Adds a clang-tidy config file, as well as a wrapper to easily use clang-tidy in a catkin workspace. Default behaviour is to generate a file for each package of the requested changes in workspace/clang-tidy-fixes. For example, workspace/clang-tidy-fixes/package1_fixes. If the -f option is specified, the tool will automatically attempt to fix the issues it encounters. This behaviour is not the default since although clang-tidy is great at finding and describing errors, it can often do a poor job of fixing issues itself.
~TODO: Still need to add ability to blacklist/whitelist packages, since currently all packages in the workspace will be tidied.~
Added in d85d37b. Syntax: run_clang_tidy.py [packages...]. If no packages are specified, all packages in the workspace are tidied. Is able to handle metapackages.
~TODO: Need to add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON and maybe -DCMAKE_CXX_CLANG_TIDY=clang-tidy-7 to catkin config~
Added in b8144ad
Full help text:
usage: run_clang_tidy.py [-h] [-f] [-j JOBS] [-q] [-v]
[packages [packages ...]]
Wrapper for running clang-tidy on a catkin workspace.
positional arguments:
packages List of packages to tidy
optional arguments:
-h, --help show this help message and exit
-f, --fix Attempt to automatically fix issues
-j JOBS, --jobs JOBS Number of packages to tidy concurrently (default=4)
-q, --quiet Do not produce any stdout output
-v, --verbose Output generated changefiles to stdout
Note: In order for clang-tidy to understand which files to tidy, the workspace
must be built with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON.
Pull Request
Closes #37. Adds a
clang-tidy
config file, as well as a wrapper to easily useclang-tidy
in a catkin workspace. Default behaviour is to generate a file for each package of the requested changes inworkspace/clang-tidy-fixes
. For example,workspace/clang-tidy-fixes/package1_fixes
. If the-f
option is specified, the tool will automatically attempt to fix the issues it encounters. This behaviour is not the default since althoughclang-tidy
is great at finding and describing errors, it can often do a poor job of fixing issues itself.~TODO: Still need to add ability to blacklist/whitelist packages, since currently all packages in the workspace will be tidied.~ Added in d85d37b. Syntax:
run_clang_tidy.py [packages...]
. If no packages are specified, all packages in the workspace are tidied. Is able to handle metapackages.~TODO: Need to add
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
and maybe-DCMAKE_CXX_CLANG_TIDY=clang-tidy-7
to catkin config~ Added in b8144adFull help text:
Contribution Checklist
Change Checklist