-
Notifications
You must be signed in to change notification settings - Fork 2
Sourcery Starbot ⭐ refactored brendancsmith/splinterbot #5
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
| cart = panelBrowser.parse_shopping_cart() | ||
|
|
||
| return cart | ||
| return panelBrowser.parse_shopping_cart() |
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 EnrollmentChecker.check_shopping_cart refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
|
|
||
| def nav_home(self): | ||
| self.driver.visit('http://' + self.domain) | ||
| self.driver.visit(f'http://{self.domain}') |
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 MyRedBrowser.nav_home refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| if not self.domain in self.driver.url: | ||
| self.driver.visit('http://' + self.domain) | ||
| if self.domain not in self.driver.url: | ||
| self.driver.visit(f'http://{self.domain}') |
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 WFBrowser.nav_home refactored with the following changes:
- Simplify logical expression using De Morgan identities (
de-morgan) - Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| optionValues = [el.value for el in optionEls] | ||
|
|
||
| return optionValues | ||
| return [el.value for el in optionEls] |
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 WFBrowser.option_values_of_select refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| username = raw_input(userLabel + ': ') | ||
| password = getpass(passLabel + ': ') | ||
| username = raw_input(f'{userLabel}: ') | ||
| password = getpass(f'{passLabel}: ') |
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 LoginManager.ask refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
| try: | ||
| assert len(value) == 2 | ||
| except (TypeError, AssertionError): | ||
| pass | ||
| else: | ||
| try: | ||
| assert len(value) == 2 | ||
| except (TypeError, AssertionError): | ||
| pass | ||
| else: | ||
| login = LoginManager.Login(*value) | ||
| return super(LoginManager, self).__setitem__(key, login) | ||
| login = LoginManager.Login(*value) | ||
| return super(LoginManager, self).__setitem__(key, login) |
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 LoginManager.__setitem__ refactored with the following changes:
- Remove unnecessary else after guard condition (
remove-unnecessary-else)
| def _extend_driver(driver): | ||
| def find_by_text(self, text): | ||
| return self.find_by_xpath("//*[text()='%s']" % text) | ||
| return self.find_by_xpath(f"//*[text()='{text}']") |
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 Browser._extend_driver refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| # avoid colons in the email message | ||
| with GmailServer(self.address, self.password) as mailServer: | ||
| print('sending: ' + msg) | ||
| print(f'sending: {msg}') |
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 Gmail.send_email refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
Apply Sweep Rules to your PR?
|
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: