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 /tests/test_epylint.py | |
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 'tests/test_epylint.py')
-rw-r--r-- | tests/test_epylint.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_epylint.py b/tests/test_epylint.py index 525627166..796b1ca87 100644 --- a/tests/test_epylint.py +++ b/tests/test_epylint.py @@ -20,6 +20,7 @@ def example_path(tmp_path): def test_epylint_good_command(example_path): out, err = lint.py_run( + # pylint: disable-next=consider-using-f-string "%s -E --disable=E1111 --msg-template '{category} {module} {obj} {line} {column} {msg}'" % example_path, return_std=True, @@ -37,6 +38,7 @@ def test_epylint_good_command(example_path): def test_epylint_strange_command(example_path): out, err = lint.py_run( + # pylint: disable-next=consider-using-f-string "%s -E --disable=E1111 --msg-template={category} {module} {obj} {line} {column} {msg}" % example_path, return_std=True, |