Skip to content
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

[robotframework] Make tags case insensitive #10

Merged
merged 2 commits into from
Jan 27, 2022

Conversation

1ivliev
Copy link
Contributor

@1ivliev 1ivliev commented Jan 27, 2022

No description provided.

@@ -270,9 +270,9 @@ def log_message(self, message):

def _extract_ids(self, list_of_tags: List[str]) -> List[int]:
return [
int(re.match(r"Q-(\d+)", tag).groups()[0])
int(re.match(r"[Q,q]-(\d+)", tag).groups()[0])
Copy link

Choose a reason for hiding this comment

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

  • r"(?i)Q-(\d+)"
  • re.match(r"q-(\d+)", tag, flags=re.IGNORECASE)

Copy link

Choose a reason for hiding this comment

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

but, better:

id = re.compile(r"Q-(\d+)", re.IGNORECASE)
return [
  int(id.match(tag).groups()[0]) for tag in list_of_tags if id.fullmatch(tag)
]

@sonarcloud
Copy link

sonarcloud bot commented Jan 27, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kamilsk kamilsk merged commit 0e44842 into master Jan 27, 2022
@kamilsk kamilsk deleted the rf_make_tags_case_insensive branch January 27, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants