diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..15e2707 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,12 @@ +--- +Checks: 'readability-function-size, readability-math-missing-parentheses, readability-duplicate-include' +WarningsAsErrors: '.*' +HeaderFileExtensions: ['h'] +ImplementationFileExtensions: ['c'] +HeaderFilterRegex: 'inc/.*\\.h$' + +CheckOptions: + - key: readability-function-size.LineThreshold + value: '25' + - key: readability-function-size.ParameterThreshold + value: '5' diff --git a/Taskfile.yml b/Taskfile.yml index ca492f3..f69cd3e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -30,6 +30,13 @@ tasks: silent: true desc: "Build the project in release build in stripped mode" + norm: + preconditions: + - sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path build {{else}} test -d build {{end}}' + msg: "Norm required compile_commands.json files please build the project before !" + cmds: + - clang-tidy -p ./build src/**/*.c + build-dev: preconditions: - sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path dist {{else}} test ! -d dist {{end}}'