-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix orphan fragments with numbers (#564)
* Add test for orphan fragments with numbers * Fix fragment parsing with stray numbers and dots fixes #562 Co-authored-by: Adi Roiban <[email protected]>
- Loading branch information
Showing
6 changed files
with
74 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
.vs/ | ||
.vscode | ||
Justfile | ||
*egg-info/ | ||
_trial_temp*/ | ||
apidocs/ | ||
dist/ | ||
|
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 @@ | ||
Orphan newsfragments containing numeric values are no longer accidentally associated to tickets. In previous versions the orphan marker was ignored and the newsfragment was associated to a ticket having the last numerical value from the filename. |
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,2 @@ | ||
Fragments with filenames like `fix-1.2.3.feature` are now associated with the ticket `fix-1.2.3`. | ||
In previous versions they were incorrectly associated to ticket `3`. |
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 |
---|---|---|
|
@@ -43,6 +43,14 @@ def _test_command(self, command): | |
f.write("Orphaned feature") | ||
with open("foo/newsfragments/+xxx.feature", "w") as f: | ||
f.write("Another orphaned feature") | ||
with open("foo/newsfragments/+123_orphaned.feature", "w") as f: | ||
f.write("An orphaned feature starting with a number") | ||
with open("foo/newsfragments/+12.3_orphaned.feature", "w") as f: | ||
f.write("An orphaned feature starting with a dotted number") | ||
with open("foo/newsfragments/+orphaned_123.feature", "w") as f: | ||
f.write("An orphaned feature ending with a number") | ||
with open("foo/newsfragments/+orphaned_12.3.feature", "w") as f: | ||
f.write("An orphaned feature ending with a dotted number") | ||
# Towncrier ignores files that don't have a dot | ||
with open("foo/newsfragments/README", "w") as f: | ||
f.write("Blah blah") | ||
|
@@ -52,7 +60,7 @@ def _test_command(self, command): | |
|
||
result = runner.invoke(command, ["--draft", "--date", "01-01-2001"]) | ||
|
||
self.assertEqual(0, result.exit_code) | ||
self.assertEqual(0, result.exit_code, result.output) | ||
self.assertEqual( | ||
result.output, | ||
dedent( | ||
|
@@ -70,9 +78,13 @@ def _test_command(self, command): | |
-------- | ||
- Baz levitation (baz) | ||
- Baz fix levitation (#2) | ||
- Baz fix levitation (fix-1.2) | ||
- Adds levitation (#123) | ||
- Extends levitation (#124) | ||
- An orphaned feature ending with a dotted number | ||
- An orphaned feature ending with a number | ||
- An orphaned feature starting with a dotted number | ||
- An orphaned feature starting with a number | ||
- Another orphaned feature | ||
- Orphaned feature | ||
|
@@ -405,6 +417,7 @@ def test_draft_no_date(self): | |
call(["git", "init"]) | ||
call(["git", "config", "user.name", "user"]) | ||
call(["git", "config", "user.email", "[email protected]"]) | ||
call(["git", "config", "commit.gpgSign", "false"]) | ||
call(["git", "add", "."]) | ||
call(["git", "commit", "-m", "Initial Commit"]) | ||
|
||
|
@@ -429,6 +442,7 @@ def test_no_confirmation(self): | |
call(["git", "init"]) | ||
call(["git", "config", "user.name", "user"]) | ||
call(["git", "config", "user.email", "[email protected]"]) | ||
call(["git", "config", "commit.gpgSign", "false"]) | ||
call(["git", "add", "."]) | ||
call(["git", "commit", "-m", "Initial Commit"]) | ||
|
||
|
@@ -458,6 +472,7 @@ def test_keep_fragments(self, runner): | |
call(["git", "init"]) | ||
call(["git", "config", "user.name", "user"]) | ||
call(["git", "config", "user.email", "[email protected]"]) | ||
call(["git", "config", "commit.gpgSign", "false"]) | ||
call(["git", "add", "."]) | ||
call(["git", "commit", "-m", "Initial Commit"]) | ||
|
||
|
@@ -491,6 +506,7 @@ def test_yes_keep_error(self, runner): | |
call(["git", "init"]) | ||
call(["git", "config", "user.name", "user"]) | ||
call(["git", "config", "user.email", "[email protected]"]) | ||
call(["git", "config", "commit.gpgSign", "false"]) | ||
call(["git", "add", "."]) | ||
call(["git", "commit", "-m", "Initial Commit"]) | ||
|
||
|
@@ -519,6 +535,7 @@ def test_confirmation_says_no(self): | |
call(["git", "init"]) | ||
call(["git", "config", "user.name", "user"]) | ||
call(["git", "config", "user.email", "[email protected]"]) | ||
call(["git", "config", "commit.gpgSign", "false"]) | ||
call(["git", "add", "."]) | ||
call(["git", "commit", "-m", "Initial Commit"]) | ||
|
||
|
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