[
https://issues.apache.org/jira/browse/MESOS-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15193114#comment-15193114
]
Benjamin Bannier commented on MESOS-4907:
-----------------------------------------
[~lins05] One possible approach would be to integrate {{clang-tidy}} into the
build so that all needed files are present, e.g. by using a compiler wrapper
like [Bear|https://github.com/rizsotto/Bear] to create a compilation database
for {{clang-tidy}} to digest.
The advantage of this would be that we implicitly make sure that all of the
many compiler flags (like e.g., {{#defines}}) are always passed to
{{clang-tidy}} as well. In the past relative paths for include paths were [an
issue for clang tools|https://llvm.org/bugs/show_bug.cgi?id=24710], but this
was fixed for clang-3.8 which we seem to require now for {{clang-format}} at
least. It comes with the disadvantage that creating the compilation database
requires a full build without e.g., {{ccache}}, but this shouldn't be an issue
in e.g., CI builds. For developers it might be good enough to manually refresh
the database from time to time. This issue will disappear once a complete cmake
build becomes available which can create the needed database without requiring
a build.
> ClangTidy Integration
> ---------------------
>
> Key: MESOS-4907
> URL: https://issues.apache.org/jira/browse/MESOS-4907
> Project: Mesos
> Issue Type: Epic
> Components: technical debt
> Reporter: Michael Park
> Labels: gsoc, gsoc2016, mentor, mesosphere
>
> While {{cpplint}} has been a useful tool as a C++ linter for quite some time,
> It carries limitations since it does its best without actually parsing C++.
> [ClangTidy|http://clang.llvm.org/extra/clang-tidy/] is a clang tool that is
> based
> off of Clang, and has the advantage that it has access to a full AST.
> There are many checks that come built-in with {{clang-tidy}} which are very
> useful,
> but we can extend it to fit Mesos coding style and patterns as well.
> The initial phase of the project will be to create a basis with which to
> leverage
> the existing checks as applicable to Mesos, then to create a scaffolding to
> add
> custom checks, and ways to integrate the custom checks to infrastructure such
> as Mesos ReviewBot, or Apache CI.
> I've done some preliminary, experimental work for this for a Hackathon project
> and have given a
> [presentation|https://docs.google.com/presentation/d/1z_qGzpY7Mt46TXxuLRW6M5HcCWBLRz6UJfd4bPknYeg/edit?usp=sharing]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)