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

refactor: Replace hardcoded version number with a constant #129

Merged

Conversation

flyingbot91
Copy link
Contributor

What

Replace hardcoded version number with a constant.

Why

Prevent duplicated values in strings.

References

None.

@flyingbot91 flyingbot91 requested a review from a team as a code owner August 14, 2023 12:57
@github-actions
Copy link

Conventional Commits Report

😢 No conventional commits found.

👉 Learn more about the conventional commits usage at Greenbone.

@flyingbot91 flyingbot91 force-pushed the use_variables_in_hardcoded_paths branch from 7730283 to 5494417 Compare August 14, 2023 13:01
@flyingbot91 flyingbot91 changed the title Replace hardcoded version number with a constant refactor: Replace hardcoded version number with a constant Aug 14, 2023
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

Hi, I am really not sure about this PR. At least you should replace os.path with parhlib.

@flyingbot91 flyingbot91 force-pushed the use_variables_in_hardcoded_paths branch 2 times, most recently from fc28187 to af31351 Compare August 14, 2023 21:00
@flyingbot91
Copy link
Contributor Author

Hi, I am really not sure about this PR. At least you should replace os.path with parhlib.

I gave pathlib a thought.

However, since there are several path variables in the code containing a trailing slash (for instance in the unittests) and pathlib.Path() seems to ignore it I declined this option.

See an example here:

"rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/scap-data/",

@bjoernricks For the moment, I decided to remove the path-like replacements and keep only the version variable replacement.

@bjoernricks bjoernricks force-pushed the use_variables_in_hardcoded_paths branch from af31351 to 0a2a447 Compare January 25, 2024 13:15
@bjoernricks bjoernricks enabled auto-merge (squash) January 25, 2024 13:16
@bjoernricks bjoernricks merged commit c585814 into greenbone:main Jan 25, 2024
14 checks passed
@bjoernricks
Copy link
Contributor

@flyingbot91 sorry I completely missed your answer and update here. Thanks a lot for the PR!

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