-
-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
6b1659c
to
3a2ac47
Compare
version_1.append(self.build) | ||
version_1.append(self.beta) | ||
version_1.append(self.rc) | ||
version_2.append(other.build) | ||
version_2.append(other.beta) | ||
version_2.append(other.rc) | ||
|
||
version_1.extend((self.build, self.beta, self.rc)) | ||
version_2.extend((other.build, other.beta, other.rc)) |
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 Version.__eq__
refactored with the following changes:
- Merge consecutive list appends into a single extend (
merge-list-appends-into-extend
)
if self.rc > 0: | ||
ret = "{}.{}.{}-rc{}".format(self.major, self.minor, self.rev, self.rc) | ||
else: | ||
ret = "{}.{}.{}".format(self.major, self.minor, self.rev) | ||
return ret | ||
return ( | ||
f"{self.major}.{self.minor}.{self.rev}-rc{self.rc}" | ||
if self.rc > 0 | ||
else f"{self.major}.{self.minor}.{self.rev}" | ||
) |
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 Version.getBasicString
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
) - Replace if statement with if expression (
assign-if-exp
) - Replace call to format with f-string. (
use-fstring-for-formatting
)
return "{}.{}.{}.{}".format(self.major, self.minor, self.rev, self.build) | ||
return f"{self.major}.{self.minor}.{self.rev}.{self.build}" |
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 Version.toParseableString
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
version = "{}.{}.{}-rc{} (b{})".format( | ||
self.major, self.minor, self.rev, self.rc, self.build | ||
) | ||
return f"{self.major}.{self.minor}.{self.rev}-rc{self.rc} (b{self.build})" | ||
elif self.isSnapshot(): | ||
version = "{}.{}.{}-SNAPSHOT (b{})".format( | ||
self.major, self.minor, self.rev, self.build | ||
) | ||
return f"{self.major}.{self.minor}.{self.rev}-SNAPSHOT (b{self.build})" | ||
elif self.build is not None: | ||
version = "{}.{}.{} (b{})".format( | ||
self.major, self.minor, self.rev, self.build | ||
) | ||
return f"{self.major}.{self.minor}.{self.rev} (b{self.build})" | ||
else: | ||
version = "{}.{}.{}".format(self.major, self.minor, self.rev) | ||
return version | ||
return f"{self.major}.{self.minor}.{self.rev}" |
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 Version.toString
refactored with the following changes:
- Lift return into if (
lift-return-into-if
) - Replace call to format with f-string. (
use-fstring-for-formatting
)
src/java/util/__init__.py
Outdated
ret += "_{}".format(self.country) | ||
ret += f"_{self.country}" | ||
if self.variant: | ||
ret += "_{}".format(self.variant) | ||
ret += f"_{self.variant}" |
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 Locale.__str__
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
src/system/file.py
Outdated
suffix = ".{}".format(extension) | ||
suffix = f".{extension}" |
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 getTempFile
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
src/system/gui.py
Outdated
label = JLabel("{}: ".format(message)) | ||
label = JLabel(f"{message}: ") |
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 inputBox
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
src/system/sfc.py
Outdated
raise KeyError("Invalid UUID string: {}".format(instanceId)) | ||
raise KeyError(f"Invalid UUID string: {instanceId}") |
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 cancelChart
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
src/system/sfc.py
Outdated
raise KeyError("Invalid UUID string: {}".format(instanceId)) | ||
raise KeyError(f"Invalid UUID string: {instanceId}") |
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 pauseChart
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
src/system/sfc.py
Outdated
raise KeyError("Invalid UUID string: {}".format(instanceId)) | ||
raise KeyError(f"Invalid UUID string: {instanceId}") |
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 resumeChart
refactored with the following changes:
- Replace call to format with f-string. (
use-fstring-for-formatting
)
- add sourcery configuration file - rollback unwanted refactorings
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.86%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Branch
main
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
main
branch, then run:Help us improve this pull request!