Revert "Fix buildozer fix tests that assume 1/0 for known boolean fields (#1360)"
This reverts commit d5bd18580d56d474e654ba2b0439cf59bf3ac13d.
diff --git a/edit/fix.go b/edit/fix.go
index 99d6e35..f45224a 100644
--- a/edit/fix.go
+++ b/edit/fix.go
@@ -133,20 +133,20 @@
if !def {
if pkgDecl == nil || pkgDecl.Attr("default_testonly") == nil {
def = strings.HasPrefix(pkg, "javatests/")
- } else if pkgDecl.AttrLiteral("default_testonly") == "1" || pkgDecl.AttrLiteral("default_testonly") == "True" {
+ } else if pkgDecl.AttrLiteral("default_testonly") == "1" {
def = true
- } else if pkgDecl.AttrLiteral("default_testonly") != "0" && pkgDecl.AttrLiteral("default_testonly") != "False" {
+ } else if pkgDecl.AttrLiteral("default_testonly") != "0" {
// Non-literal value: it's not safe to do a change.
return false
}
}
testonly := r.AttrLiteral("testonly")
- if def && (testonly == "1" || testonly == "True") {
+ if def && testonly == "1" {
r.DelAttr("testonly")
return true
}
- if !def && (testonly == "0" || testonly == "False") {
+ if !def && testonly == "0" {
r.DelAttr("testonly")
return true
}