Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63d59eb7 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Use only single dash for tidy flags

* Work around RBE preprocessor bug, which rejects double dash flags.

Bug: 217778010
Test: make tidy-soong_subset
Change-Id: Ic7c0a95ae7afefb49cc9d124fd3c9f38fe2e0f56
parent 99a81c8d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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() {