summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-07-30Add clang-tidy-fix target to MakefileTobias Markmann
This has clang-tidy write changes out to YAML files in parallel and finally runs clang-apply-replacements which merges, deduplicates and applies the changes in serial. Uses Python to determine the number of parallel jobs to run. Test-Information: Tested by adding new checks and running clang-tidy-fix. Works as described above and is much faster compared to a serial `clang-tidy -fix` run. Change-Id: Idb357e63edeba75ef9a4fb53f5ddef2a7c3c23ee
2018-07-27Add clang-tidy supportKevin Smith
This adds a single check (which is already enough to fail). clang-tidy < 7 requires absolute paths in the compile-commands.json, which isn't what will happen here. If you want to run with a previous version (6 is latest, 7 expected in a month), apply this patch (which will break normal ninja compilation, thus not applying it properly, and I'm not sure it's worth any time getting it work when the clang-tidy bug is fixed imminently): diff --git a/BuildTools/scons2ninja.py b/BuildTools/scons2ninja.py index df4c6559d..13e78d650 100755 --- a/BuildTools/scons2ninja.py +++ b/BuildTools/scons2ninja.py @@ -168,8 +168,16 @@ class NinjaBuilder : self.variables += str(name) + " = " + str(value) + "\n" def build(self, target, rule, sources = None, **kwargs) : + if is_list(target): + target = [os.path.abspath(x) for x in target] + else: + target = os.path.abspath(target) self._build += "build " + self.to_string(target) + ": " + rule if sources : + if is_list(sources): + sources = [os.path.abspath(x) for x in sources] + elif isinstance(sources, basestring): + sources = os.path.abspath(sources) self._build += " " + self.to_string(sources) if 'deps' in kwargs and kwargs['deps'] : self._build += " | " + self.to_string(kwargs["deps"]) Test-Information: Running make clang-tidy spits out complaints about the code. Change-Id: Ic9f43fd2e11ebd595b4b8a5cee8d290cd5349abf