diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-08-30 07:57:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 07:57:05 +0200 |
commit | 66ffcbc4c59e41327be1a2b5ef65727bf0314aa9 (patch) | |
tree | 5b1f37a0ffadc2888f851337b36f75717ebf4c72 /script | |
parent | 1a19421058dcc04446f8b91a825ed1078959d87a (diff) | |
download | pylint-git-66ffcbc4c59e41327be1a2b5ef65727bf0314aa9.tar.gz |
Add ``Consider-using-f-string`` checker (#4796)
* Add ``consider-using-f-string`` checker
This adds a checker for normal strings which are formatted
with ``.format()`` or '%'.
The message is a convention to nudge users towards using f-strings.
This closes #3592
* Update pylint code to use f-strings
After adding `consider-using-f-strings` the codebase showed numerous
cases of formatting which could be f-strings.
This commit changes most of these to become f-strings, or adds ignores.
* Apply suggestions from code review
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'script')
-rw-r--r-- | script/bump_changelog.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/script/bump_changelog.py b/script/bump_changelog.py index 8d8225379..6b8e4abbf 100644 --- a/script/bump_changelog.py +++ b/script/bump_changelog.py @@ -18,7 +18,7 @@ RELEASE_DATE_TEXT = "Release date: TBA" WHATS_NEW_TEXT = "What's New in Pylint" TODAY = datetime.now() FULL_WHATS_NEW_TEXT = WHATS_NEW_TEXT + " {version}?" -NEW_RELEASE_DATE_MESSAGE = "Release date: {}".format(TODAY.strftime("%Y-%m-%d")) +NEW_RELEASE_DATE_MESSAGE = f"Release date: {TODAY.strftime('%Y-%m-%d')}" def main() -> None: @@ -128,10 +128,14 @@ def transform_content(content: str, version: str) -> str: def do_checks(content, next_version, version, version_type): err = "in the changelog, fix that first!" NEW_VERSION_ERROR_MSG = ( - "The text for this version '{version}' did not exists %s" % err + # pylint: disable-next=consider-using-f-string + "The text for this version '{version}' did not exists %s" + % err ) NEXT_VERSION_ERROR_MSG = ( - "The text for the next version '{version}' already exists %s" % err + # pylint: disable-next=consider-using-f-string + "The text for the next version '{version}' already exists %s" + % err ) wn_next_version = get_whats_new(next_version) wn_this_version = get_whats_new(version) |