Merge "Use only single dash for tidy flags" am: def9bf2c1c am: df8fe32206

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1972547

Change-Id: I12f4c1acbfc61dd1d0f70cf4c9871a028182f3a2
This commit is contained in:
Chih-hung Hsieh
2022-02-08 22:47:59 +00:00
committed by Automerger Merge Worker

View File

@@ -102,6 +102,12 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
}
flags.TidyFlags = append(flags.TidyFlags, headerFilter)
}
// Work around RBE bug in parsing clang-tidy flags, replace "--flag" with "-flag".
// Some C/C++ modules added local tidy flags like --header-filter= and --extra-arg-before=.
doubleDash := regexp.MustCompile("^('?)--(.*)$")
for i, s := range flags.TidyFlags {
flags.TidyFlags[i] = doubleDash.ReplaceAllString(s, "$1-$2")
}
// If clang-tidy is not enabled globally, add the -quiet flag.
if !ctx.Config().ClangTidy() {