Sourcery refactored master branch#31
Open
sourcery-ai[bot] wants to merge 1 commit into
Open
Conversation
| return sys.platform | ||
|
|
||
| return platforms[sys.platform] | ||
| return platforms.get(sys.platform, sys.platform) |
Author
There was a problem hiding this comment.
Function get_platform refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else) - Swap if/else branches (
swap-if-else-branches) - Replace if statement with if expression (
assign-if-exp) - Simplify dictionary access using default get (
default-get)
Comment on lines
-52
to
+49
| print("| Version " + RIICONNECT24DNSSERVER_VERSION + " |") | ||
| print(f"| Version {RIICONNECT24DNSSERVER_VERSION} |") |
Author
There was a problem hiding this comment.
Lines 52-52 refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
Comment on lines
-135
to
+132
| if q.qtype == QTYPE.ANY or q.qtype == self._rtype: | ||
| if q.qtype in [QTYPE.ANY, self._rtype]: |
Author
There was a problem hiding this comment.
Function Record.try_rr refactored with the following changes:
- Replace multiple comparisons of same variable with
inoperator (merge-comparisons)
Comment on lines
-142
to
+139
| if self._rtype in (QTYPE.NS, QTYPE.SOA): | ||
| return 60 * 60 * 24 | ||
| else: | ||
| return 300 | ||
| return 60 * 60 * 24 if self._rtype in (QTYPE.NS, QTYPE.SOA) else 300 |
Author
There was a problem hiding this comment.
Function Record.sensible_ttl refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp)
Comment on lines
-152
to
+146
| return '{} {}'.format(QTYPE[self._rtype], self.kwargs) | ||
| return f'{QTYPE[self._rtype]} {self.kwargs}' |
Author
There was a problem hiding this comment.
Function Record.__str__ refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch
masterrefactored 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
masterbranch, then run:Help us improve this pull request!