Skip to content

Commit

Permalink
Allow dot ('.') in workspace names.
Browse files Browse the repository at this point in the history
RELNOTES: Dot ('.') is now allowed in workspace names. See #11837.
PiperOrigin-RevId: 327160423
  • Loading branch information
aiuto authored and copybara-github committed Aug 18, 2020
1 parent b970667 commit 9993785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
public class WorkspaceGlobals implements WorkspaceGlobalsApi {

// Must start with a letter and can contain letters, numbers, underscores and hyphens.
private static final Pattern LEGAL_WORKSPACE_NAME = Pattern.compile("^\\p{Alpha}[\\w-]*$");
private static final Pattern LEGAL_WORKSPACE_NAME = Pattern.compile("^\\p{Alpha}[-.\\w]*$");

private final boolean allowOverride;
private final RuleFactory ruleFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public void testWorkspaceStartsWithNumber() throws Exception {

@Test
public void testWorkspaceWithIllegalCharacters() throws Exception {
helper.parse("workspace(name = 'a.b.c')");
assertThat(helper.getParserError()).contains("a.b.c is not a legal workspace name");
helper.parse("workspace(name = 'a+b+c')");
assertThat(helper.getParserError()).contains("a+b+c is not a legal workspace name");
}

@Test
Expand Down

0 comments on commit 9993785

Please sign in to comment.