-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored main branch #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
base: main
Are you sure you want to change the base?
Conversation
# Yapılandırmanın önceden kullanılan değişkeni kullanarak düzenlenip düzenlenmediğini kontrol edin. | ||
# Temel olarak, yapılandırma dosyası için kontrol. | ||
AYAR_KONTROL = os.environ.get("___________LUTFEN_______BU_____SATIRI_____SILIN__________", None) | ||
|
||
if AYAR_KONTROL: | ||
if AYAR_KONTROL := os.environ.get( | ||
"___________LUTFEN_______BU_____SATIRI_____SILIN__________", None | ||
): |
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.
Lines 15-19
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
This removes the following comments ( why? ):
# Yapılandırmanın önceden kullanılan değişkeni kullanarak düzenlenip düzenlenmediğini kontrol edin.
# Temel olarak, yapılandırma dosyası için kontrol.
self.konsol.print("✅"+yazi, style="bold green", width=70, justify="center") | ||
self.konsol.print(f"✅{yazi}", style="bold green", width=70, justify="center") |
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 Amil.basarili_is
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
if type == "str" or type == "string": | ||
return str(self.konsol.input(f"[red]{self.oturum}:[/][cyan]~/../{self.get_location()[-2] + '/' + self.get_location()[-1]}[/]{' [green][[/][yellow] ' + info + ' [/][green]][/] ' if info else ''}[cyan]>> ")) | ||
elif type == "int" or type == "integer": | ||
return int(self.konsol.input(f"[red]{self.oturum}:[/][cyan]~/../{self.get_location()[-2] + '/' + self.get_location()[-1]}[/]{' [green][[/][yellow] ' + info + ' [/][green]][/] ' if info else ''}[cyan]>> ")) | ||
if type in {"str", "string"} or type not in ["int", "integer"]: | ||
return str( | ||
self.konsol.input( | ||
f"[red]{self.oturum}:[/][cyan]~/../{self.get_location()[-2]}/{self.get_location()[-1]}[/]{f' [green][[/][yellow] {info} [/][green]][/] ' if info else ''}[cyan]>> " | ||
) | ||
) | ||
else: | ||
return str(self.konsol.input(f"[red]{self.oturum}:[/][cyan]~/../{self.get_location()[-2] + '/' + self.get_location()[-1]}[/]{' [green][[/][yellow] ' + info + ' [/][green]][/] ' if info else ''}[cyan]>> ")) | ||
return int( | ||
self.konsol.input( | ||
f"[red]{self.oturum}:[/][cyan]~/../{self.get_location()[-2]}/{self.get_location()[-1]}[/]{f' [green][[/][yellow] {info} [/][green]][/] ' if info else ''}[cyan]>> " | ||
) | ||
) |
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 Amil.option
refactored with the following changes:
- Merge duplicate blocks in conditional (
merge-duplicate-blocks
) - Simplify unnecessary nesting, casting and constant values in f-strings [×2] (
simplify-fstring-formatting
) - Use f-string instead of string concatenation [×8] (
use-fstring-for-concatenation
) - Remove redundant conditional (
remove-redundant-if
) - Replace multiple comparisons of same variable with
in
operator [×2] (merge-comparisons
) - Use set when checking membership of a collection of literals (
collection-into-set
)
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!