Skip to content

Commit

Permalink
Add --//some/path:incompatible_some_flag as a valid incompatible flag…
Browse files Browse the repository at this point in the history
… format (#125)

Closes #118
  • Loading branch information
aiuto authored Apr 17, 2020
1 parent 1d49bc7 commit 1e4c5df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions bazelisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion bazelisk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down
2 changes: 1 addition & 1 deletion sample-issues-migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1e4c5df

Please sign in to comment.