-
Notifications
You must be signed in to change notification settings - Fork 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
Sourcery Starbot ⭐ refactored vbuxbaum/lng-api #10
base: main
Are you sure you want to change the base?
Conversation
gender_analysis = self.check_gender_neutrality(avoided_expression) | ||
if gender_analysis: | ||
if gender_analysis := self.check_gender_neutrality(avoided_expression): |
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 TextAnalyzer.check_for_avoided_expression
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
result = this_prefix + " " + result | ||
result = f"{this_prefix} {result}" | ||
if self.__analyze_sufix(this_sufix): | ||
result = result + " " + this_sufix | ||
result = f"{result} {this_sufix}" |
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 TextAnalyzer.check_gender_neutrality
refactored with the following changes:
- Use f-string instead of string concatenation [×4] (
use-fstring-for-concatenation
)
and not self.pos_tags.get(this_sufix, "") == "V" | ||
and not self.pos_tags.get(this_sufix, "") == "PROPESS" | ||
and not self.pos_tags.get(this_sufix, "") == "ART" | ||
and self.pos_tags.get(this_sufix, "") != "V" | ||
and self.pos_tags.get(this_sufix, "") != "PROPESS" | ||
and self.pos_tags.get(this_sufix, "") != "ART" |
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 TextAnalyzer.__analyze_sufix
refactored with the following changes:
- Simplify logical expression using De Morgan identities [×3] (
de-morgan
)
and not self.pos_tags.get(this_prefix, "") == "V" | ||
and self.pos_tags.get(this_prefix, "") != "V" |
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 TextAnalyzer.__analyze_prefix
refactored with the following changes:
- Simplify logical expression using De Morgan identities (
de-morgan
)
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
main
branch, then run: