-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(init): parse --public as a public name (#8603)
Fixes #7108 Signed-off-by: Etienne Millon <me@emillon.org>
- Loading branch information
Showing
10 changed files
with
118 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- dune init: parse `--public` as a public name (#8603, fixes #7108, @emillon) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
#7108: foo-bar is a valid public name, we should accept it. | ||
|
||
$ dune init lib foo_bar --public foo-bar | ||
dune: option '--public': invalid component name `foo-bar' | ||
Library names must be non-empty and composed only of the | ||
following | ||
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'. | ||
Usage: dune init library [OPTION]… NAME [PATH] | ||
Try 'dune init library --help' or 'dune --help' for more information. | ||
[1] | ||
Success: initialized library component named foo_bar |
9 changes: 9 additions & 0 deletions
9
test/blackbox-tests/test-cases/dune-init/public-implicit-invalid.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
When a public name is implicit from the name, it should still be validated as a | ||
public name. | ||
|
||
$ dune init lib 0 --public | ||
Error: Public names are composed of an opam package name and optional | ||
dot-separated string suffixes. | ||
Package names can contain letters, numbers, '-', '_' and '+', and need to | ||
contain at least a letter. | ||
[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
Sub-library names should be accepted: | ||
|
||
$ dune init lib lib_s1_s2 --public lib.sub1.sub2 | ||
dune: option '--public': invalid component name `lib.sub1.sub2' | ||
Library names must be non-empty and composed only of the | ||
following | ||
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'. | ||
Usage: dune init library [OPTION]… NAME [PATH] | ||
Try 'dune init library --help' or 'dune --help' for more information. | ||
[1] | ||
Success: initialized library component named lib_s1_s2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters