-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore: replace deprecated LegacyVersion with own one #4043
Conversation
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.
☃️
checkov/common/packaging/version.py
Outdated
return False | ||
|
||
|
||
_legacy_version_component_re = re.compile(r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE) |
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.
are the spaces part of the regular expression?
also, i suggest to add flag for case insensitive
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.
the spaces don't seem to do anything for this use case, just kept them as they were. but will add ignorecase to it
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.
Are you sure? the space are meaningful in regex. did you check this? if yes, i will approve it
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.
yeap, I tested it. It didn't change the output with or without the spaces.
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.
in general you are right that spaces are meaningful, but not for what it is used here
* replace depreacted LegacyVersion with own one * upgrade to latest packaging version * fix mypy * fix linting * add ignorecase flag
* replace depreacted LegacyVersion with own one * upgrade to latest packaging version * fix mypy * fix linting * add ignorecase flag
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
Checklist: