summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author MÃ¥rten Kongstad <marten.kongstad@sony.com> 2019-01-21 13:44:36 +0100
committer Todd Kennedy <toddke@google.com> 2019-02-07 09:27:16 -0800
commitaabca6c00f38bae094de5321ceff19f46f28a222 (patch)
tree9538f77d4e8acfadb94448995d8b698886232571
parent74d6997124a55043cccf505e7091ba326d51d6f8 (diff)
idmap2: fix static checks
Fix two errors detected by static-checks.sh: - bpfmt: remove -s flag (sort arrays) since it makes no sense to order clang-tidy flags alphabetically: flags must be passed to clang-tidy in the order specified to make sense - cpplint: allow NOLINT(cert-dcl50-cpp) Test: cmds/idmap2/static-checks.sh Change-Id: I6677f8e7504551746edae458acd523e643044c7e
-rwxr-xr-xcmds/idmap2/static-checks.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmds/idmap2/static-checks.sh b/cmds/idmap2/static-checks.sh
index ad9830b8a096..067000a38b83 100755
--- a/cmds/idmap2/static-checks.sh
+++ b/cmds/idmap2/static-checks.sh
@@ -59,7 +59,7 @@ function _clang_format()
function _bpfmt()
{
- local output="$(bpfmt -s -d $bp_files)"
+ local output="$(bpfmt -d $bp_files)"
if [[ "$output" ]]; then
echo "$output"
return 1
@@ -72,6 +72,7 @@ function _cpplint()
local cpplint="${ANDROID_BUILD_TOP}/tools/repohooks/tools/cpplint.py"
local output="$($cpplint --quiet $cpp_files 2>&1 >/dev/null | grep -v \
-e 'Found C system header after C++ system header.' \
+ -e 'Unknown NOLINT error category: cert-dcl50-cpp' \
-e 'Unknown NOLINT error category: misc-non-private-member-variables-in-classes' \
)"
if [[ "$output" ]]; then
@@ -115,7 +116,7 @@ if [[ $opt_mode == "check" ]]; then
exit $errors
elif [[ $opt_mode == "fix" ]]; then
clang-format -style=file -i $cpp_files
- bpfmt -s -w $bp_files
+ bpfmt -w $bp_files
exit 0
elif [[ $opt_mode == "help" ]]; then
echo "Run static analysis tools such as clang-format and cpplint on the idmap2"