From 3c298a3725deb47247b7ed62003f9ffb42a493b5 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 4 Mar 2021 17:44:03 +0000 Subject: [PATCH] Reformat license code to comply with preupload checks Bug: 181070625 Test: m nothing Change-Id: I0b7c8613fcb7bc4e96908e391f1e46a9168f2507 --- android/license.go | 2 +- android/license_test.go | 6 +- android/licenses.go | 2 +- android/licenses_test.go | 116 +++++++++++++++++++-------------------- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/android/license.go b/android/license.go index b140b55b1..3bc6199b2 100644 --- a/android/license.go +++ b/android/license.go @@ -19,7 +19,7 @@ import ( ) type licenseKindDependencyTag struct { - blueprint.BaseDependencyTag + blueprint.BaseDependencyTag } var ( diff --git a/android/license_test.go b/android/license_test.go index 552bbaee0..9f6871374 100644 --- a/android/license_test.go +++ b/android/license_test.go @@ -49,9 +49,9 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ - `other/Blueprints:2:5: module "arule": depends on //top:top_allowed_as_notice `+ + `other/Blueprints:2:5: module "arule": depends on //top:top_allowed_as_notice ` + `which is not visible to this module`, - `yetmore/Blueprints:2:5: module "//yetmore": depends on //top:top_allowed_as_notice `+ + `yetmore/Blueprints:2:5: module "//yetmore": depends on //top:top_allowed_as_notice ` + `which is not visible to this module`, }, }, @@ -70,7 +70,7 @@ var licenseTests = []struct { }`), }, expectedErrors: []string{ - `top/Blueprints:6:5: module "top_proprietary": license_kinds property `+ + `top/Blueprints:6:5: module "top_proprietary": license_kinds property ` + `"top_by_exception_only" is not a license_kind module`, }, }, diff --git a/android/licenses.go b/android/licenses.go index 100042911..2838f5d28 100644 --- a/android/licenses.go +++ b/android/licenses.go @@ -51,7 +51,7 @@ type applicableLicensesPropertyImpl struct { func newApplicableLicensesProperty(name string, licensesProperty *[]string) applicableLicensesProperty { return applicableLicensesPropertyImpl{ - name: name, + name: name, licensesProperty: licensesProperty, } } diff --git a/android/licenses_test.go b/android/licenses_test.go index b94add7cf..c04379108 100644 --- a/android/licenses_test.go +++ b/android/licenses_test.go @@ -7,15 +7,15 @@ import ( ) var licensesTests = []struct { - name string - fs map[string][]byte - expectedErrors []string - effectiveLicenses map[string][]string - effectiveInheritedLicenses map[string][]string - effectivePackage map[string]string - effectiveNotices map[string][]string - effectiveKinds map[string][]string - effectiveConditions map[string][]string + name string + fs map[string][]byte + expectedErrors []string + effectiveLicenses map[string][]string + effectiveInheritedLicenses map[string][]string + effectivePackage map[string]string + effectiveNotices map[string][]string + effectiveKinds map[string][]string + effectiveConditions map[string][]string }{ { name: "invalid module type without licenses property", @@ -71,28 +71,28 @@ var licensesTests = []struct { }, effectiveLicenses: map[string][]string{ "libexample1": []string{"top_Apache2"}, - "libnested": []string{"top_Apache2"}, - "libother": []string{"top_Apache2"}, + "libnested": []string{"top_Apache2"}, + "libother": []string{"top_Apache2"}, }, effectiveKinds: map[string][]string{ "libexample1": []string{"notice"}, - "libnested": []string{"notice"}, - "libother": []string{"notice"}, + "libnested": []string{"notice"}, + "libother": []string{"notice"}, }, effectivePackage: map[string]string{ "libexample1": "topDog", - "libnested": "topDog", - "libother": "topDog", + "libnested": "topDog", + "libother": "topDog", }, effectiveConditions: map[string][]string{ "libexample1": []string{"shownotice"}, - "libnested": []string{"shownotice"}, - "libother": []string{"shownotice"}, + "libnested": []string{"shownotice"}, + "libother": []string{"shownotice"}, }, effectiveNotices: map[string][]string{ "libexample1": []string{"top/LICENSE", "top/NOTICE"}, - "libnested": []string{"top/LICENSE", "top/NOTICE"}, - "libother": []string{"top/LICENSE", "top/NOTICE"}, + "libnested": []string{"top/LICENSE", "top/NOTICE"}, + "libother": []string{"top/LICENSE", "top/NOTICE"}, }, }, @@ -147,28 +147,28 @@ var licensesTests = []struct { }`), }, effectiveLicenses: map[string][]string{ - "libexample": []string{"nested_other", "top_other"}, + "libexample": []string{"nested_other", "top_other"}, "libsamepackage": []string{}, - "libnested": []string{}, - "libother": []string{}, + "libnested": []string{}, + "libother": []string{}, }, effectiveInheritedLicenses: map[string][]string{ - "libexample": []string{"nested_other", "top_other"}, + "libexample": []string{"nested_other", "top_other"}, "libsamepackage": []string{"nested_other", "top_other"}, - "libnested": []string{"nested_other", "top_other"}, - "libother": []string{"nested_other", "top_other"}, + "libnested": []string{"nested_other", "top_other"}, + "libother": []string{"nested_other", "top_other"}, }, effectiveKinds: map[string][]string{ - "libexample": []string{"nested_notice", "top_notice"}, + "libexample": []string{"nested_notice", "top_notice"}, "libsamepackage": []string{}, - "libnested": []string{}, - "libother": []string{}, + "libnested": []string{}, + "libother": []string{}, }, effectiveConditions: map[string][]string{ - "libexample": []string{"notice"}, + "libexample": []string{"notice"}, "libsamepackage": []string{}, - "libnested": []string{}, - "libother": []string{}, + "libnested": []string{}, + "libother": []string{}, }, }, { @@ -218,32 +218,32 @@ var licensesTests = []struct { }`), }, effectiveLicenses: map[string][]string{ - "libexample": []string{"other", "top_nested"}, + "libexample": []string{"other", "top_nested"}, "libsamepackage": []string{}, - "libnested": []string{}, - "libother": []string{}, - "liboutsider": []string{}, + "libnested": []string{}, + "libother": []string{}, + "liboutsider": []string{}, }, effectiveInheritedLicenses: map[string][]string{ - "libexample": []string{"other", "top_nested"}, + "libexample": []string{"other", "top_nested"}, "libsamepackage": []string{"other", "top_nested"}, - "libnested": []string{"other", "top_nested"}, - "libother": []string{"other", "top_nested"}, - "liboutsider": []string{"other", "top_nested"}, + "libnested": []string{"other", "top_nested"}, + "libother": []string{"other", "top_nested"}, + "liboutsider": []string{"other", "top_nested"}, }, effectiveKinds: map[string][]string{ - "libexample": []string{}, + "libexample": []string{}, "libsamepackage": []string{}, - "libnested": []string{}, - "libother": []string{}, - "liboutsider": []string{}, + "libnested": []string{}, + "libother": []string{}, + "liboutsider": []string{}, }, effectiveNotices: map[string][]string{ - "libexample": []string{"top/nested/LICENSE.txt"}, + "libexample": []string{"top/nested/LICENSE.txt"}, "libsamepackage": []string{}, - "libnested": []string{}, - "libother": []string{}, - "liboutsider": []string{}, + "libnested": []string{}, + "libother": []string{}, + "liboutsider": []string{}, }, }, @@ -285,11 +285,11 @@ var licensesTests = []struct { }`), }, effectiveLicenses: map[string][]string{ - "libexample": []string{"by_exception_only"}, + "libexample": []string{"by_exception_only"}, "libdefaults": []string{"notice"}, }, effectiveInheritedLicenses: map[string][]string{ - "libexample": []string{"by_exception_only"}, + "libexample": []string{"by_exception_only"}, "libdefaults": []string{"notice"}, }, }, @@ -327,11 +327,11 @@ var licensesTests = []struct { }`), }, effectiveLicenses: map[string][]string{ - "libexample": []string{"top_notice"}, + "libexample": []string{"top_notice"}, "liboutsider": []string{}, }, effectiveInheritedLicenses: map[string][]string{ - "libexample": []string{"top_notice"}, + "libexample": []string{"top_notice"}, "liboutsider": []string{"top_notice"}, }, }, @@ -370,15 +370,15 @@ var licensesTests = []struct { }`), }, effectiveLicenses: map[string][]string{ - "libexample": []string{"top_notice"}, - "libnested": []string{"outsider"}, - "libother": []string{}, + "libexample": []string{"top_notice"}, + "libnested": []string{"outsider"}, + "libother": []string{}, "liboutsider": []string{}, }, effectiveInheritedLicenses: map[string][]string{ - "libexample": []string{"top_notice"}, - "libnested": []string{"outsider"}, - "libother": []string{}, + "libexample": []string{"top_notice"}, + "libnested": []string{"outsider"}, + "libother": []string{}, "liboutsider": []string{"top_notice", "outsider"}, }, }, @@ -449,7 +449,7 @@ var licensesTests = []struct { }, effectiveInheritedLicenses: map[string][]string{ "module": []string{"prebuilt", "top_sources"}, - "other": []string{"prebuilt", "top_sources"}, + "other": []string{"prebuilt", "top_sources"}, }, }, }