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

chore: replace deprecated LegacyVersion with own one #4043

Merged
merged 6 commits into from
Dec 12, 2022

Conversation

gruebel
Copy link
Contributor

@gruebel gruebel commented Dec 11, 2022

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gruebel gruebel marked this pull request as draft December 11, 2022 21:54
@gruebel gruebel marked this pull request as ready for review December 12, 2022 13:51
Copy link
Contributor

@Eliran-Turgeman Eliran-Turgeman left a comment

Choose a reason for hiding this comment

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

☃️

return False


_legacy_version_component_re = re.compile(r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE)
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@gruebel gruebel merged commit 2153e7c into bridgecrewio:main Dec 12, 2022
@gruebel gruebel deleted the replace-legacy-version branch December 12, 2022 21:45
gruebel added a commit to gruebel/checkov that referenced this pull request Dec 12, 2022
* replace depreacted LegacyVersion with own one

* upgrade to latest packaging version

* fix mypy

* fix linting

* add ignorecase flag
gruebel added a commit to gruebel/checkov that referenced this pull request Dec 12, 2022
* replace depreacted LegacyVersion with own one

* upgrade to latest packaging version

* fix mypy

* fix linting

* add ignorecase flag
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.

3 participants