Skip to content

Commit

Permalink
💚 Fix Norm command clang-tidy
Browse files Browse the repository at this point in the history
When an error is detected by clang-tidy the return code is not a non zero value so it's embarrassing So to remedy the problem I create a command in Taskfile. When an error is occured the return code is non zero value otherwise is just 0
  • Loading branch information
Unam3dd committed Jun 14, 2024
1 parent 677e41c commit bf3f20f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ tasks:
desc: "Build the project in release build in stripped mode"

norm:
platforms: ["linux"]
preconditions:
- sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path build {{else}} test -d build {{end}}'
- sh: 'test -d build'
msg: "Norm required compile_commands.json files please build the project before !"
cmds:
- clang-tidy -p ./build src/**/*.c
- CLANG_TIDY=$(clang-tidy -p ./build main.c | grep "warning"); [[ ! -z "$CLANG_TIDY" ]] && return 1 || return 0;
silent: true
desc: "Pass the norm on the project"

Expand Down

0 comments on commit bf3f20f

Please sign in to comment.