bake Debug -p MyLibraryProject --lint
DefaultToolchain GCC {
...
LintPolicy "$(ProjectDir)/lint/misra.lnt"
LintPolicy "$(ProjectDir)/lint/suppressions.lnt"
}
make -f .../PcLint/../lnt/co-gcc.mak
You will get some lnt files: gcc-include-path.lnt, lint_cmac.h, lint_cppmac.h and size-options.lnt.-i".../PcLint/.../lnt"
-i"...pathToTheLntFilesExtractedAbove"
gcc-include-path.lnt
.../PcLint/.../lnt/co-gcc.lnt
Afterwards you can test lint directly without bake like this:
lint-nt your.lnt test.cpp
To use in bake, add a LintPolicy in Project.meta:
LintPolicy ".../your.lnt"
DefaultToolchain GCC {
LintPolicy "-os($(MainProjectDir)/$(ProjectName)_$(ConfigName)_lintout.xml)"
LintPolicy "-v"
LintPolicy "+xml(doc)"
LintPolicy "-format=%f %l %t %n
%m "
LintPolicy "-format_specific= "
LintPolicy "-pragma(message)"
bake Debug -p MyLibraryProject --lint --lint_max 50 (lints the first 51 files)
bake Debug -p MyLibraryProject --lint --lint_min 51 --lint_max 100 (lints the next 50 files)
bake Debug -p MyLibraryProject --lint --lint_min 101 (lints the rest of the files)
Currently the lint output is buffered and not shown before lint has finished a project. The reason is the implementation of the error parser. This will change in future.
If you have another lint command than lint-nt.exe, use an alias.