summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2021-03-29 20:00:59 -0700
committerAnthony Sottile <asottile@umich.edu>2021-03-30 17:37:13 -0700
commite9a2a1018349f3eda9811bcadb63d4e2af05fd2f (patch)
treecaa31e569fb0e8e639f24295a8b7f05222747020
parentc4c4351699442195df64d3540d58c9fe221a48ae (diff)
downloadflake8-e9a2a1018349f3eda9811bcadb63d4e2af05fd2f.tar.gz
audit % format calls
-rw-r--r--src/flake8/options/config.py2
-rw-r--r--src/flake8/plugins/manager.py6
-rw-r--r--src/flake8/plugins/pyflakes.py8
-rw-r--r--src/flake8/processor.py2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py
index 0a2e039..8fa5fb0 100644
--- a/src/flake8/options/config.py
+++ b/src/flake8/options/config.py
@@ -344,7 +344,7 @@ def get_local_plugins(config_finder):
base_dirs = {os.path.dirname(cf) for cf in config_files}
- section = "%s:local-plugins" % config_finder.program_name
+ section = f"{config_finder.program_name}:local-plugins"
for plugin_type in ["extension", "report"]:
if config.has_option(section, plugin_type):
local_plugins_string = config.get(section, plugin_type).strip()
diff --git a/src/flake8/plugins/manager.py b/src/flake8/plugins/manager.py
index d36f95b..a7f285a 100644
--- a/src/flake8/plugins/manager.py
+++ b/src/flake8/plugins/manager.py
@@ -138,9 +138,9 @@ class Plugin:
self._plugin = self.entry_point.load()
if not callable(self._plugin):
msg = (
- "Plugin %r is not a callable. It might be written for an"
- " older version of flake8 and might not work with this"
- " version" % self._plugin
+ f"Plugin {self._plugin!r} is not a callable. It might be "
+ f"written for an older version of flake8 and might not work "
+ f"with this version"
)
LOG.critical(msg)
raise TypeError(msg)
diff --git a/src/flake8/plugins/pyflakes.py b/src/flake8/plugins/pyflakes.py
index 9709887..8c68a01 100644
--- a/src/flake8/plugins/pyflakes.py
+++ b/src/flake8/plugins/pyflakes.py
@@ -165,10 +165,10 @@ class FlakesChecker(pyflakes.checker.Checker):
)
if inc_exc:
raise ValueError(
- '"%s" was specified in both the '
- "include-in-doctest and exclude-from-doctest "
- "options. You are not allowed to specify it in "
- "both for doctesting." % inc_exc
+ f"{inc_exc!r} was specified in both the "
+ f"include-in-doctest and exclude-from-doctest "
+ f"options. You are not allowed to specify it in "
+ f"both for doctesting."
)
def run(self):
diff --git a/src/flake8/processor.py b/src/flake8/processor.py
index fdecfa8..73dd12b 100644
--- a/src/flake8/processor.py
+++ b/src/flake8/processor.py
@@ -438,7 +438,7 @@ def log_token(log: logging.Logger, token: _Token) -> None:
if token[2][0] == token[3][0]:
pos = "[{}:{}]".format(token[2][1] or "", token[3][1])
else:
- pos = "l.%s" % token[3][0]
+ pos = f"l.{token[3][0]}"
log.log(
flake8._EXTRA_VERBOSE,
"l.%s\t%s\t%s\t%r"