Repository navigation
Conversation
Allow specification items in Markdown and reStructuredText to declare coverage inline on the same line as the 'Covers:' keyword (e.g. `Covers: req~etc~1`). Add design item `dsn~md.covers-single-line~1`, update user guide, and add unit/parser tests.
redcatbear
left a comment
There was a problem hiding this comment.
Thank you @InAnYan for this contribution. Nice addition.
I have a couple of small change requests to tighten the change.
Sorry for the late review. Very busy at the moment.
| // [impl->dsn~md.covers-single-line~1] | ||
| /** Matches an inline requirement reference. Capture group 1 holds the first ID. */ | ||
| public static final String REFERENCE_INLINE = "\\s*.*?(" | ||
| + SpecificationItemId.ID_PATTERN + ").*"; |
There was a problem hiding this comment.
This regex feels to wide. The spaces should not appear here. Word boundary markers would be more fitting
|
|
||
| // [utest->dsn~md.covers-single-line~1] | ||
| @ParameterizedTest | ||
| @ValueSource(strings = { " req~name~1", " `req~name~1`", "[link](#req~name~1)", |
There was a problem hiding this comment.
The example with the anchor is illegal. The anchor reference should not be recognized as valid reference.
A valid Markdown Link would look like this:
[feat~support-hid-devices~1](#support-human-interface-devices)
To be honest, I don't think the inline notation makes sense in combination with links, because they take up too much space and make the specs less readable than the bulleted version.
| CODE_BEGIN(" *[`~]{3,30}\\w*\\s*"), | ||
| CODE_END(" *[`~]{3,30}\\s*"), | ||
| COMMENT("Comment:\\s*"), | ||
| COVERS_INT("Covers:" + PatternConstants.REFERENCE_INLINE), |
There was a problem hiding this comment.
Be more strict please: Comma separated list after the colon with optional spaces.
|
|
||
| // [utest->dsn~md.covers-single-line~1] | ||
| @ParameterizedTest | ||
| @CsvSource( |
There was a problem hiding this comment.
If its one dimensional, use ValueSource please.
| // [utest->dsn~md.covers-single-line~1] | ||
| @ParameterizedTest | ||
| @CsvSource( | ||
| { "Covers:", "#Covers: req~foo~1", "' Covers: req~foo~1'", "Covers: abc" }) |
There was a problem hiding this comment.
Also add bad weather scenarios for typical typos: semicolons instead of a colons, forgotten colon, joined IDs with no separator.
| { | ||
| final SpecificationItem item = importText(""" | ||
| req~subject~1 | ||
| Covers: req~covered~2 |
There was a problem hiding this comment.
Use test with at least two values separated by comma, just to be sure.
|
|
||
| // @formatter:off | ||
| COMMENT("Comment:\\s*"), | ||
| COVERS_INT("Covers:" + PatternConstants.REFERENCE_INLINE), |
There was a problem hiding this comment.
Restrict to comma-separated list with optional spaces.
…sttrace/importer/lightweightmarkup/PatternConstants.java Co-authored-by: Sebastian Bär <sebastian.baer@exasol.com>
…sttrace/importer/lightweightmarkup/PatternConstantsTest.java Co-authored-by: Sebastian Bär <sebastian.baer@exasol.com>
|
Hi! Thanks for the review! No pressure I think I addressed most of the comments |
Closes #617
DISCLAIMER: Made by AI, guided by me. I take full responsibility of the code. I have reviewed the code, and the code seems for me okay, but I don't have a big experience in the OFT codebase. Feel free to tell me if anything is off.
PR content:
dsn, similar to the ones forNeeds:)