8000 Sourcery refactored master branch by sourcery-ai[bot] · Pull Request #1 · Powerm4/ripme · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link
@sourcery-ai sourcery-ai bot commented Aug 25, 2023

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:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Powerm4 August 25, 2023 06:19
@Powerm4 Powerm4 temporarily deployed to github-pages August 25, 2023 06:28 — with GitHub Pages Inactive
@github-pages github-pages bot temporarily deployed to github-pages August 25, 2023 06:33 Inactive
@Powerm4 Powerm4 removed their request for review August 25, 2023 06:35
@github-pages github-pages bot temporarily deployed to github-pages August 25, 2023 06:35 Inactive
@Powerm4 Powerm4 self-requested a review August 25, 2023 06:47
@Powerm4 Powerm4 self-assigned this Aug 25, 2023
print('Current version ' + currentVersion)
print(f'Current version {currentVersion}')
Copy link
Owner

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/))

print('Current version ' + currentVersion)
print(f'Current version {currentVersion}')
Copy link
Author

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:

print("Checking if {} is a jar file".format(filename))
print(f"Checking if {filename} is a jar file")
Copy link
Author

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:

print(r"Checking if {} matches pattern ^\d+\.\d+\.\d+:".format(message))
print(f"Checking if {message} matches pattern ^\d+\.\d+\.\d+:")
Copy link
Author

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:

Comment on lines -67 to +83
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))
print(f"Reading file {fileToUploadPath}")
Copy link
Author

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:

Copy link
@code-review-doctor code-review-doctor bot left a 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(

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.

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.

1 participant
0