diff options
author | John Hood <cgull@glup.org> | 2017-08-06 22:00:24 -0400 |
---|---|---|
committer | John Hood <cgull@glup.org> | 2017-08-06 22:00:24 -0400 |
commit | 9df71ae5ad7e83f3c376e9f4483a9c2cc9a54bb5 (patch) | |
tree | a8daae38b2c2c20721121c32a452668978574b51 /Makefile.am | |
parent | 4f068d726192a051d61095954f15faec1ade624b (diff) |
Add support for OCLint static checker.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index f4914fb..478a3da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,14 @@ AM_DISTCHECK_CONFIGURE_FLAGS = --enable-compile-warnings=distcheck --enable-exam # non-Automake defines CPPCHECK_FLAGS = --enable=all --template=gcc --force # -j8 disables unused function checking. CLANG_SCAN_BUILD = scan-build +BEAR = bear +OCLINT_JCD = oclint-json-compilation-database +OCLINT_OPTIONS = -enable-global-analysis -max-priority-2=1000 -max-priority-3=1000 \ + -rc LONG_LINE=160 \ + -rc LONG_VARIABLE_NAME=40 \ + -rc SHORT_VARIABLE_NAME=1 \ + -rc MINIMUM_CASES_IN_SWITCH=2 + .PHONY: VERSION VERSION: @@ -29,7 +37,7 @@ version.h: VERSION @rm -f version.h.new clean-local: - @rm -rf version.h VERSION cov-int mosh-coverity.txz + @rm -rf version.h VERSION cov-int mosh-coverity.txz compile_commands.json # Linters and static checkers, for development only. Not included in # build dependencies, and outside of Automake processing. @@ -47,6 +55,15 @@ cov-build: cov-build --dir cov-int $(MAKE) check TESTS= tar -caf mosh-coverity.txz cov-int +# These two rules are for Bear + OCLint. +# Don't *run* the tests, prediction-unicode.test generates arguments +# with illegal UTF-8 that make Bear unhappy. +compile_commands.json: + $(MAKE) clean + bear $(MAKE) check TESTS= +oclint: compile_commands.json + $(OCLINT_JCD) -e src/protobufs -- $(OCLINT_OPTIONS) + # Clang's scan-build static checker. scan-build: $(MAKE) clean |