From 1e4c5df59ebf03feb6ec01fc489751f1db62b89e Mon Sep 17 00:00:00 2001 From: aiuto Date: Fri, 17 Apr 2020 08:43:35 -0400 Subject: [PATCH] Add --//some/path:incompatible_some_flag as a valid incompatible flag format (#125) Closes #118 --- bazelisk.go | 4 ++++ bazelisk_test.go | 2 +- sample-issues-migration.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bazelisk.go b/bazelisk.go index a3c2a3a8..341dbcbc 100644 --- a/bazelisk.go +++ b/bazelisk.go @@ -571,8 +571,12 @@ func scanIssuesForIncompatibleFlags(issuesJSON []byte) (map[string]*flagDetails, } re := regexp.MustCompile(`^incompatible_\w+`) + s_re := regexp.MustCompile(`^//.*[^/]:incompatible_\w+`) for _, issue := range issueList.Items { flag := re.FindString(issue.Title) + if len(flag) <= 0 { + flag = s_re.FindString(issue.Title) + } if len(flag) > 0 { name := "--" + flag result[name] = &flagDetails{ diff --git a/bazelisk_test.go b/bazelisk_test.go index 092fa15b..9af45a50 100644 --- a/bazelisk_test.go +++ b/bazelisk_test.go @@ -23,10 +23,10 @@ func TestScanIssuesForIncompatibleFlags(t *testing.T) { t.Errorf("Could not parse sample issues") } expected_flagnames := []string{ + "--//some/path:incompatible_user_defined_flag", "--incompatible_always_check_depset_elements", "--incompatible_no_implicit_file_export", "--incompatible_remove_enabled_toolchain_types", - "--incompatible_remove_local_resources", "--incompatible_remove_ram_utilization_factor", "--incompatible_validate_top_level_header_inclusions", } diff --git a/sample-issues-migration.json b/sample-issues-migration.json index ed337ba5..e69fe175 100644 --- a/sample-issues-migration.json +++ b/sample-issues-migration.json @@ -87,7 +87,7 @@ "id": 546480392, "node_id": "MDU6SXNzdWU1NDY0ODAzOTI=", "number": 10536, - "title": "incompatible_remove_local_resources", + "title": "//some/path:incompatible_user_defined_flag", "user": { "login": "susinmotion", "id": 7410705,