bp2build: codegen singleton lists on one line.

This CL refactors the bp2build code generator to pretty print lists with
a single element on one line, instead of taking up three lines, which
can make BUILD files unnecessarily long. A single line singleton list is
also more commonly used in BUILD files.

Test: TH
Change-Id: Ic9e44741bbb070c8f45925466b9ccdd0608498b2
This commit is contained in:
Jingwen Chen
2021-04-08 14:40:57 +00:00
parent 6393098ecf
commit b4628eb03f
8 changed files with 142 additions and 354 deletions

View File

@@ -74,9 +74,7 @@ func TestShBinaryBp2Build(t *testing.T) {
}`,
expectedBazelTargets: []string{`sh_binary(
name = "foo",
srcs = [
"foo.sh",
],
srcs = ["foo.sh"],
)`},
},
}