Loading bp2build/cc_library_conversion_test.go +21 −3 Original line number Diff line number Diff line Loading @@ -3642,6 +3642,15 @@ func TestCcLibraryWithTidy(t *testing.T) { cc_library_static { name: "foo", srcs: ["foo.cpp"], } cc_library_static { name: "foo-no-tidy", srcs: ["foo.cpp"], tidy: false, } cc_library_static { name: "foo-tidy", srcs: ["foo.cpp"], tidy: true, tidy_checks: ["check1", "check2"], tidy_checks_as_errors: ["check1error", "check2error"], Loading @@ -3652,7 +3661,16 @@ cc_library_static { MakeBazelTarget("cc_library_static", "foo", AttrNameToString{ "local_includes": `["."]`, "srcs": `["foo.cpp"]`, "tidy": `True`, }), MakeBazelTarget("cc_library_static", "foo-no-tidy", AttrNameToString{ "local_includes": `["."]`, "srcs": `["foo.cpp"]`, "tidy": `"never"`, }), MakeBazelTarget("cc_library_static", "foo-tidy", AttrNameToString{ "local_includes": `["."]`, "srcs": `["foo.cpp"]`, "tidy": `"local"`, "tidy_checks": `[ "check1", "check2", Loading cc/bp2build.go +10 −2 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ type staticOrSharedAttributes struct { } type tidyAttributes struct { Tidy *bool Tidy *string Tidy_flags []string Tidy_checks []string Tidy_checks_as_errors []string Loading @@ -82,7 +82,15 @@ type tidyAttributes struct { func (m *Module) convertTidyAttributes(ctx android.BaseMutatorContext, moduleAttrs *tidyAttributes) { for _, f := range m.features { if tidy, ok := f.(*tidyFeature); ok { moduleAttrs.Tidy = tidy.Properties.Tidy var tidyAttr *string if tidy.Properties.Tidy != nil { if *tidy.Properties.Tidy { tidyAttr = proptools.StringPtr("local") } else { tidyAttr = proptools.StringPtr("never") } } moduleAttrs.Tidy = tidyAttr moduleAttrs.Tidy_flags = tidy.Properties.Tidy_flags moduleAttrs.Tidy_checks = tidy.Properties.Tidy_checks moduleAttrs.Tidy_checks_as_errors = tidy.Properties.Tidy_checks_as_errors Loading Loading
bp2build/cc_library_conversion_test.go +21 −3 Original line number Diff line number Diff line Loading @@ -3642,6 +3642,15 @@ func TestCcLibraryWithTidy(t *testing.T) { cc_library_static { name: "foo", srcs: ["foo.cpp"], } cc_library_static { name: "foo-no-tidy", srcs: ["foo.cpp"], tidy: false, } cc_library_static { name: "foo-tidy", srcs: ["foo.cpp"], tidy: true, tidy_checks: ["check1", "check2"], tidy_checks_as_errors: ["check1error", "check2error"], Loading @@ -3652,7 +3661,16 @@ cc_library_static { MakeBazelTarget("cc_library_static", "foo", AttrNameToString{ "local_includes": `["."]`, "srcs": `["foo.cpp"]`, "tidy": `True`, }), MakeBazelTarget("cc_library_static", "foo-no-tidy", AttrNameToString{ "local_includes": `["."]`, "srcs": `["foo.cpp"]`, "tidy": `"never"`, }), MakeBazelTarget("cc_library_static", "foo-tidy", AttrNameToString{ "local_includes": `["."]`, "srcs": `["foo.cpp"]`, "tidy": `"local"`, "tidy_checks": `[ "check1", "check2", Loading
cc/bp2build.go +10 −2 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ type staticOrSharedAttributes struct { } type tidyAttributes struct { Tidy *bool Tidy *string Tidy_flags []string Tidy_checks []string Tidy_checks_as_errors []string Loading @@ -82,7 +82,15 @@ type tidyAttributes struct { func (m *Module) convertTidyAttributes(ctx android.BaseMutatorContext, moduleAttrs *tidyAttributes) { for _, f := range m.features { if tidy, ok := f.(*tidyFeature); ok { moduleAttrs.Tidy = tidy.Properties.Tidy var tidyAttr *string if tidy.Properties.Tidy != nil { if *tidy.Properties.Tidy { tidyAttr = proptools.StringPtr("local") } else { tidyAttr = proptools.StringPtr("never") } } moduleAttrs.Tidy = tidyAttr moduleAttrs.Tidy_flags = tidy.Properties.Tidy_flags moduleAttrs.Tidy_checks = tidy.Properties.Tidy_checks moduleAttrs.Tidy_checks_as_errors = tidy.Properties.Tidy_checks_as_errors Loading