Skip to content

bugfix/423_uniform-tag-parsing - #629

Open
redcatbear wants to merge 4 commits into
mainfrom
bugfix/423_uniform-tag-parsing
Open

redcatbear wants to merge 4 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
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

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

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?

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.

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

This branch has not been deployed

No deployments
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: 🔨 In Progress

Development

Successfully merging this pull request may close these issues.

Inconsistent parsing of tags

2 participants