[fx][lint] Fix no-op --fix option using clang-tidy
When running fx lint --fix with C++ code, the -fix option never gets
passed to clang-tidy due to an inversion in an intermediate check. Fix
the inversion.
Bug: 62803
Test: manual test using fx lint --all --fix
(fixes didn't apply for unrelated reasons but invocation works now)
Change-Id: I4838881c8b0c1bb3dcc93a84233b0479aab8f478
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/443269
Commit-Queue: Xo Wang <xow@google.com>
Reviewed-by: Joshua Seaton <joshuaseaton@google.com>
Testability-Review: Joshua Seaton <joshuaseaton@google.com>
diff --git a/tools/devshell/contrib/lint b/tools/devshell/contrib/lint
index ca162a5b..9730ea5 100755
--- a/tools/devshell/contrib/lint
+++ b/tools/devshell/contrib/lint
@@ -177,7 +177,7 @@
-clang-tidy-binary "${CLANG_TIDY}"
-clang-apply-replacements-binary "${CLANG_APPLY_REPLACEMENTS}"
)
-if [[ -z "${FIX_OPTION}" ]]; then
+if [[ -n "${FIX_OPTION}" ]]; then
CLANG_TIDY_CMD+=( ${FIX_OPTION} )
fi