From 403e0ea38871f33570d3bff77f69832e77e3b692 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 24 Oct 2019 10:48:33 -0700 Subject: Document commands to run clang-tidy clang-tidy is a useful tool for automatically finding bad coding patterns. Add documentation for how to run it manually. Tested: Docs change. Ran commands and verified that clang-tidy runs. Signed-off-by: Ed Tanous Change-Id: Ibff23be17af9042c2c5d9769c5d5570e5bbe7e3e --- DEVELOPING.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'DEVELOPING.md') diff --git a/DEVELOPING.md b/DEVELOPING.md index cd8b5c44d3..c277666f2a 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -109,7 +109,7 @@ implement a concrete interface. 11. ### phosphor webui - The webserver should be capable of hosting phosphor-webui, and impelmenting + The webserver should be capable of hosting phosphor-webui, and implementing the required flows to host the application. In general, all access methods should be available to the webui. @@ -196,3 +196,21 @@ See the [REST](https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md) and [Redfish](https://github.com/openbmc/docs/blob/master/REDFISH-cheatsheet.md) cheatsheets for valid commands. + +## clang-tidy + +clang-tidy is a tool that can be used to identify coding style violations, bad +design patterns, and bug prone contructs. It's not guaranteed that all tests +pass, but ideally should be run on new code to find issues. To run, make sure +you have clang++-9 installed, and clang-tidy-9 installed, and run. the -checks +field can be modified to enable or disable which clang-tidy checks are run. +The below enables everything in the cert namespace. + +``` +mkdir build +cd build +cmake .. -DCMAKE_CXX_COMPILER=clang++-9 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +make -j +run-clang-tidy-9 -p . -header-filter=".*" -checks="-*,cert-*" +``` + -- cgit v1.2.3