Improve error message when a module is double enabled.
Bug: None Test: Manual Change-Id: Ie96dd76d628e8ac3f0da06b949e9bfb9a3259dce
This commit is contained in:
@@ -443,8 +443,8 @@ func (b *BazelModuleBase) shouldConvertWithBp2build(ctx bazelOtherModuleContext,
|
|||||||
if ok, directoryPath := bp2buildDefaultTrueRecursively(packagePath, allowlist.defaultConfig); ok {
|
if ok, directoryPath := bp2buildDefaultTrueRecursively(packagePath, allowlist.defaultConfig); ok {
|
||||||
if moduleNameAllowed {
|
if moduleNameAllowed {
|
||||||
ctx.ModuleErrorf("A module cannot be in a directory marked Bp2BuildDefaultTrue"+
|
ctx.ModuleErrorf("A module cannot be in a directory marked Bp2BuildDefaultTrue"+
|
||||||
" or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: '%s'",
|
" or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: '%s'"+
|
||||||
directoryPath)
|
" Module: '%s'", directoryPath, moduleName)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -266,7 +266,7 @@ func TestBp2BuildAllowlist(t *testing.T) {
|
|||||||
{
|
{
|
||||||
description: "module allowlist and enabled directory",
|
description: "module allowlist and enabled directory",
|
||||||
shouldConvert: false,
|
shouldConvert: false,
|
||||||
expectedErrors: []string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir'"},
|
expectedErrors: []string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir' Module: 'foo'"},
|
||||||
module: TestBazelModule{
|
module: TestBazelModule{
|
||||||
TestModuleInfo: bazel.TestModuleInfo{
|
TestModuleInfo: bazel.TestModuleInfo{
|
||||||
ModuleName: "foo",
|
ModuleName: "foo",
|
||||||
@@ -287,7 +287,7 @@ func TestBp2BuildAllowlist(t *testing.T) {
|
|||||||
{
|
{
|
||||||
description: "module allowlist and enabled subdirectory",
|
description: "module allowlist and enabled subdirectory",
|
||||||
shouldConvert: false,
|
shouldConvert: false,
|
||||||
expectedErrors: []string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir'"},
|
expectedErrors: []string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir' Module: 'foo'"},
|
||||||
module: TestBazelModule{
|
module: TestBazelModule{
|
||||||
TestModuleInfo: bazel.TestModuleInfo{
|
TestModuleInfo: bazel.TestModuleInfo{
|
||||||
ModuleName: "foo",
|
ModuleName: "foo",
|
||||||
|
Reference in New Issue
Block a user