Skip to content
Snippets Groups Projects
Commit 4c783757 authored by swym's avatar swym Committed by rahix
Browse files

build: Add clang-tidy support


Co-authored-by: default avatarRahix <rahix@rahix.de>
parent 4ed95885
No related branches found
No related tags found
No related merge requests found
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,bugprone-*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
User: swym
CheckOptions:
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
...
......@@ -4,3 +4,4 @@ __pycache__/
*.pyc
.*.swp
*~
compile_commands.json
......@@ -46,6 +46,22 @@ version_hdr = custom_target(
command: [files('tools/version-header.sh'), '@OUTPUT@'],
)
jq = find_program('jq', required: false)
if jq.found()
compile_commands = custom_target(
'compile_commands_tidy.json',
build_by_default: true,
output: 'compile_commands_tidy.json',
command: [
files('tools/convert-ccjson.sh'),
meson.current_source_dir(),
meson.current_build_dir(),
'@OUTPUT@',
],
)
endif
subdir('lib/')
subdir('bootloader/')
......
[.[]|({
directory:.directory,
command:(. as {file:$file, directory:$directory}
|.command
|sub("-fno-isolate-erroneous-paths-dereference";"-m32")
|sub("(?<a>\\s)\\.\\./"; (.a) + "\($directory)/../")
|sub("/build/\\.\\./"; "/")
)
,
file:((.directory|sub("build$";""))+(.file|sub("^../";"")))
})]
#!/usr/bin/env bash
set -e
if [[ "$#" == 0 ]]; then
echo "usage: $0 <sourcedir> <compile_commands_file>"
exit 1
fi
script_dir="$(dirname "$0")"
source_dir="$1"
build_dir="$2"
output="$3"
jq -f "$script_dir/compile_commands.jq" "$build_dir/compile_commands.json" >"$source_dir/compile_commands.json"
if [[ "$output" != "" ]]; then
touch "$output"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment