audit % format calls

This commit is contained in:
Anthony Sottile 2021-03-29 20:00:59 -07:00
parent c4c4351699
commit e9a2a10183
4 changed files with 9 additions and 9 deletions

View file

@ -344,7 +344,7 @@ def get_local_plugins(config_finder):
base_dirs = {os.path.dirname(cf) for cf in config_files} 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"]: for plugin_type in ["extension", "report"]:
if config.has_option(section, plugin_type): if config.has_option(section, plugin_type):
local_plugins_string = config.get(section, plugin_type).strip() local_plugins_string = config.get(section, plugin_type).strip()

View file

@ -138,9 +138,9 @@ class Plugin:
self._plugin = self.entry_point.load() self._plugin = self.entry_point.load()
if not callable(self._plugin): if not callable(self._plugin):
msg = ( msg = (
"Plugin %r is not a callable. It might be written for an" f"Plugin {self._plugin!r} is not a callable. It might be "
" older version of flake8 and might not work with this" f"written for an older version of flake8 and might not work "
" version" % self._plugin f"with this version"
) )
LOG.critical(msg) LOG.critical(msg)
raise TypeError(msg) raise TypeError(msg)

View file

@ -165,10 +165,10 @@ class FlakesChecker(pyflakes.checker.Checker):
) )
if inc_exc: if inc_exc:
raise ValueError( raise ValueError(
'"%s" was specified in both the ' f"{inc_exc!r} was specified in both the "
"include-in-doctest and exclude-from-doctest " f"include-in-doctest and exclude-from-doctest "
"options. You are not allowed to specify it in " f"options. You are not allowed to specify it in "
"both for doctesting." % inc_exc f"both for doctesting."
) )
def run(self): def run(self):

View file

@ -438,7 +438,7 @@ def log_token(log: logging.Logger, token: _Token) -> None:
if token[2][0] == token[3][0]: if token[2][0] == token[3][0]:
pos = "[{}:{}]".format(token[2][1] or "", token[3][1]) pos = "[{}:{}]".format(token[2][1] or "", token[3][1])
else: else:
pos = "l.%s" % token[3][0] pos = f"l.{token[3][0]}"
log.log( log.log(
flake8._EXTRA_VERBOSE, flake8._EXTRA_VERBOSE,
"l.%s\t%s\t%s\t%r" "l.%s\t%s\t%s\t%r"