-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored master branch #1
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
base: master
Are you sure you want to change the base?
Conversation
print('Current version ' + currentVersion) | ||
print(f'Current version {currentVersion}') |
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.
Lines
42-80
refactored with the following changes:* Use f-string instead of string concatenation [×15] ([`use-fstring-for-concatenation`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/use-fstring-for-concatenation/)) * Replace call to format with f-string [×2] ([`use-fstring-for-formatting`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/use-fstring-for-formatting/))
897abc0
to
8a2da4b
Compare
print('Current version ' + currentVersion) | ||
print(f'Current version {currentVersion}') |
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.
Lines 42-80
refactored with the following changes:
- Use f-string instead of string concatenation [×15] (
use-fstring-for-concatenation
) - Replace call to format with f-string [×2] (
use-fstring-for-formatting
)
print("Checking if {} is a jar file".format(filename)) | ||
print(f"Checking if {filename} is a jar file") |
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.
Function isJar
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
print(r"Checking if {} matches pattern ^\d+\.\d+\.\d+:".format(message)) | ||
print(f"Checking if {message} matches pattern ^\d+\.\d+\.\d+:") |
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.
Function isValidCommitMessage
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
print("[!] Error: {} does not exist".format(fileToUploadPath)) | ||
print(f"[!] Error: {fileToUploadPath} does not exist") | ||
sys.exit(1) | ||
|
||
if not isJar(fileToUploadPath): | ||
print("[!] Error: {} is not a jar file!".format(fileToUploadPath)) | ||
print(f"[!] Error: {fileToUploadPath} is not a jar file!") | ||
sys.exit(1) | ||
|
||
if not isValidCommitMessage(commitMessage): | ||
print("[!] Error: {} is not a valid commit message as it does not start with a version".format(fileToUploadPath)) | ||
print( | ||
f"[!] Error: {fileToUploadPath} is not a valid commit message as it does not start with a version" | ||
) | ||
sys.exit(1) | ||
|
||
|
||
if not args.skip_hash_check: | ||
if debug: | ||
print("Reading file {}".format(fileToUploadPath)) | ||
|
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.
Lines 67-104
refactored with the following changes:
- Replace call to format with f-string [×9] (
use-fstring-for-formatting
)
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.
Worth considering. View full project report here.
@@ -74,10 +82,12 @@ def update_change_list(message): | |||
print("Stripping jar") | |||
subprocess.call(["mvn", "io.github.zlika:reproducible-build-maven-plugin:0.6:strip-jar"]) | |||
print("Hashing .jar file") | |||
openedFile = open("./target/ripme-{}-jar-with-dependencies.jar".format(nextVersion), "rb") | |||
openedFile = open( |
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.
it
has not been closed, so consumes more resources than necessary and increases the risk of unexpected side effects. Consider calling open
as a context manager to close it automatically. More.
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run:Help us improve this pull request!