-
Notifications
You must be signed in to change notification settings - Fork 0
Promote develop to main #1013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Promote develop to main #1013
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
|
|
||
| import sys | ||
| import tempfile | ||
| import time | ||
| import unittest | ||
| from pathlib import Path | ||
|
|
||
|
|
@@ -188,6 +189,40 @@ def test_a_reference_style_markdown_link_is_rejected(self) -> None: | |
| ["Fixture: description carries Markdown links - keep it link-free plain text"], | ||
| ) | ||
|
|
||
| def test_a_nested_bracket_link_label_is_rejected(self) -> None: | ||
| # Regresses a gap where `[^\]]*` stopped at the first `]` and missed a label with its own brackets. | ||
| self.assertEqual( | ||
| validate.description_errors( | ||
| "Fixture", "See [API [docs]](https://example.test) for more." | ||
| ), | ||
| ["Fixture: description carries Markdown links - keep it link-free plain text"], | ||
| ) | ||
|
|
||
| def test_a_destination_with_two_parenthesized_groups_is_rejected(self) -> None: | ||
| # Regresses the matching gap on the destination side: more than one balanced `()` run after the link. | ||
| self.assertEqual( | ||
| validate.description_errors( | ||
| "Fixture", "See [docs](https://example.test/a_(b)_(c)) for more." | ||
| ), | ||
| ["Fixture: description carries Markdown links - keep it link-free plain text"], | ||
| ) | ||
|
|
||
| def test_a_link_nested_inside_a_non_link_bracket_run_is_still_rejected(self) -> None: | ||
| # A failed outer span used to jump past the whole run instead of retrying one character in. | ||
| # That skipped the valid inner link in `[[docs](url)]` (#1011, qodo). | ||
| self.assertEqual( | ||
| validate.description_errors("Fixture", "See [[docs](url)] for more."), | ||
| ["Fixture: description carries Markdown links - keep it link-free plain text"], | ||
| ) | ||
|
|
||
| def test_an_escaped_bracket_inside_a_label_does_not_corrupt_the_match(self) -> None: | ||
| # A backslash-escaped `\[` used to count as real nesting, corrupting the label match. | ||
| # It reads as a literal character instead (#1011, qodo). | ||
| self.assertEqual( | ||
| validate.description_errors("Fixture", r"See [API \[docs](url) for more."), | ||
| ["Fixture: description carries Markdown links - keep it link-free plain text"], | ||
| ) | ||
|
|
||
| def test_leading_or_trailing_whitespace_is_rejected(self) -> None: | ||
| # Not silently trimmed here, even though spec/audit.py and configure.sh both strip it defensively. | ||
| # Rejecting it at the source keeps the registry's own text the exact canonical form every mirror carries. | ||
|
|
@@ -206,6 +241,13 @@ def test_an_embedded_newline_is_rejected(self) -> None: | |
| ], | ||
| ) | ||
|
|
||
| def test_a_long_run_of_unmatched_brackets_stays_linear(self) -> None: | ||
| # A run of unmatched '[' used to re-scan the remaining text from every position. | ||
| # That was O(N^2) (#1011, CodeRabbit), and a slow run here means a regression back to it. | ||
| start = time.monotonic() | ||
| validate.contains_description_markdown_link("[" * 20000) | ||
| self.assertLess(time.monotonic() - start, 1.0) | ||
|
Comment on lines
+247
to
+249
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6. Wall-clock checks can flake The new regression test fails solely when one invocation takes over one wall-clock second, so a paused, contended, or coverage-instrumented CI process can fail even though _bracket_matches() remains linear. The same timing gate is duplicated in spec/audit.py --selftest, making the validation workflow vulnerable in two places. Agent Prompt
|
||
|
|
||
| def test_exactly_the_cap_is_clean(self) -> None: | ||
| self.assertEqual(validate.description_errors("Fixture", "a" * 100), []) | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. codestyle.md duplicates lint rule
📘 Rule violation⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools