Skip to content

bugfix/423_uniform-tag-parsing - #629

Merged
redcatbear merged 8 commits into
mainfrom
bugfix/423_uniform-tag-parsing
Oct 11, 2026
Merged

redcatbear merged 8 commits into
mainfrom
bugfix/423_uniform-tag-parsing

Conversation

@redcatbear

Copy link
Copy Markdown
Collaborator

Closes #423.

@redcatbear redcatbear self-assigned this Oct 9, 2026
@redcatbear redcatbear added bug ai-assisted Written with the help of an LLM labels Oct 9, 2026
Comment on lines +307 to +310
if (TAG_PATTERN.matcher(trimmed).matches())
{
this.listener.addTag(trimmed);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This silently ignores invalid tags. Should we at least log a warning to avoid surprises?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added error message with invalid tag, file, line number and allowed tag format.

public static final String ARTIFACT_TYPE = "[a-zA-Z]+";
public static final String BULLETS = "[+*-]";
// [impl->dsn~md.tags-format~1]
public static final String TAG_PATTERN = "[a-zA-Z0-9][a-zA-Z0-9_]*";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency: tag pattern was defined as \\p{Alnum}\\w* before. Use a common constant if possible.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted to the lightweight markup importer. Added Hamcrest custom matcher for checking the regular expressions.

public static final String ARTIFACT_TYPE = "[a-zA-Z]+";
public static final String BULLETS = "[+*-]";
// [impl->dsn~md.tags-format~1]
public static final String TAG_PATTERN = "[a-zA-Z0-9][a-zA-Z0-9_]*";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
25.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@redcatbear
redcatbear merged commit 4c1cad4 into main Oct 11, 2026
13 of 14 checks passed
@redcatbear
redcatbear deleted the bugfix/423_uniform-tag-parsing branch October 11, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Written with the help of an LLM bug

Projects

Status: ✅ Closed

Development

Successfully merging this pull request may close these issues.

Inconsistent parsing of tags

2 participants