blob: d2eff1b723d11ef7117094957b4a7ccb700acb59 [file] [log] [blame]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Overview
===============
kudu-lint is a Clang-based tool for looking for kudu-specific coding errors.
Currently, it only looks for cases where a function returning Status is called,
and then that Status is ignored.
Over time we can add more AST matchers for other Kudu-specific lint checks we'd
like to implement.
Requirements
===============
This has currently only been tested against clang 3.4. Clang APIs tend to change
between versions, so this is unlikely to work on earlier versions of clang.
Building
=========
Set the CLANG_ROOT environment variable to point to the path at which clang/llvm
have been installed. This is the directory which contains bin/, lib/, etc.
Run 'cmake .', followed by 'make', in this directory.
Running
=========
In the top-level kudu source directory, run:
$ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
$ find src -name \*.cc | xargs -n1 -P8 ./build-support/tools/kudu-lint/kudu-lint \
-p . -extra-arg=-I$CLANG_ROOT/lib/clang/3.4/include