-
Notifications
You must be signed in to change notification settings - Fork 8
Sourcery refactored master branch #6
base: master
Are you sure you want to change the base?
Conversation
@@ -2,6 +2,7 @@ | |||
These are the default configuration options for Django-elRTE | |||
""" | |||
|
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 25-51
refactored with the following changes:
- Replace interpolated string formatting with f-string [×7] (
replace-interpolation-with-fstring
)
'cssfiles': ['%selrte-inner.css' % elrte.settings.CSS_BASE_URL], | ||
'cssfiles': [f'{elrte.settings.CSS_BASE_URL}elrte-inner.css'], |
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 19-30
refactored with the following changes:
- Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring
)
This removes the following comments ( why? ):
# 'fmOpen': FileManagerOpener(),
html = [u'<textarea%s>%s</textarea>' % (flatatt(final_attrs), escape(value))] | ||
html = [f'<textarea{flatatt(final_attrs)}>{escape(value)}</textarea>'] |
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 ElrteTextareaWidget.render
refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
)
if content_language: | ||
content_language = content_language[:2] | ||
else: | ||
content_language = language | ||
|
||
config = {} | ||
config['language'] = language | ||
|
||
content_language = content_language[:2] if content_language else language | ||
config = {'language': language} | ||
lang_names = SortedDict() | ||
for lang, name in settings.LANGUAGES: | ||
if lang[:2] not in lang_names: lang_names[lang[:2]] = [] | ||
lang_names[lang[:2]].append(_(name)) | ||
sp_langs = [] | ||
for lang, names in lang_names.items(): | ||
if lang == content_language: | ||
default = '+' | ||
else: | ||
default = '' | ||
sp_langs.append(u'%s%s=%s' % (default, ' / '.join(names), lang)) | ||
default = '+' if lang == content_language else '' | ||
sp_langs.append(f"{default}{' / '.join(names)}={lang}") |
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 get_language_config
refactored with the following changes:
- Replace if statement with if expression [×2] (
assign-if-exp
) - Merge dictionary assignment with declaration (
merge-dict-assign
) - Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring
)
Branch
master
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
master
branch, then run:Help us improve this pull request!