Sourcery Starbot ⭐ refactored gruzewski/aws_visualiser#1
Open
SourceryAI wants to merge 1 commit intogruzewski:masterfrom
Open
Sourcery Starbot ⭐ refactored gruzewski/aws_visualiser#1SourceryAI wants to merge 1 commit intogruzewski:masterfrom
SourceryAI wants to merge 1 commit intogruzewski:masterfrom
Conversation
SourceryAI
commented
Feb 1, 2023
Comment on lines
-35
to
+46
| table = (self.name, self.id, self.state, self.vpc_id, self.az, self.platform, self._get_groups(), self.public_dns, self.public_ip, self.type) | ||
| return table | ||
| return ( | ||
| self.name, | ||
| self.id, | ||
| self.state, | ||
| self.vpc_id, | ||
| self.az, | ||
| self.platform, | ||
| self._get_groups(), | ||
| self.public_dns, | ||
| self.public_ip, | ||
| self.type, | ||
| ) |
Author
There was a problem hiding this comment.
Function Instance.tuple_info refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
Comment on lines
-39
to
+49
| return [str("%s [%s]" % (sg.name, sg.id)) for sg in self.groups] | ||
| return [str(f"{sg.name} [{sg.id}]") for sg in self.groups] |
Author
There was a problem hiding this comment.
Function Instance._get_groups refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
Comment on lines
-63
to
+73
| ec2_instances = dict() | ||
| ec2_instances = {} |
Author
There was a problem hiding this comment.
Function get_ec2_instances refactored with the following changes:
- Replace
dict()with{}(dict-literal)
Comment on lines
-84
to
+94
| print(key + ": No instances.") | ||
| print(f"{key}: No instances.") |
Author
There was a problem hiding this comment.
Function print_ec2_instances refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
Comment on lines
-98
to
+114
| print("%s [%s]" % (sg.name, sg.id)) | ||
| [print("-- from %s to %s granted for %s" % (rule.from_port, rule.to_port, ",".join([str(ip) for ip in rule.grants]))) for rule in sg.rules] | ||
| print(f"{sg.name} [{sg.id}]") | ||
| [ | ||
| print( | ||
| f'-- from {rule.from_port} to {rule.to_port} granted for {",".join([str(ip) for ip in rule.grants])}' | ||
| ) | ||
| for rule in sg.rules | ||
| ] |
Author
There was a problem hiding this comment.
Lines 98-99 refactored with the following changes:
- Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring)
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.
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: