From ec9919a088c47cd7b219592636be06a7cbb37d3b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 18 Apr 2023 12:01:08 -0400 Subject: [PATCH] chore: add Ruff logging format check Signed-off-by: Henry Schreiner --- bin/update_pythons.py | 6 +++--- bin/update_virtualenv.py | 6 +++--- pyproject.toml | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/update_pythons.py b/bin/update_pythons.py index 930b13df..bfa10ba7 100755 --- a/bin/update_pythons.py +++ b/bin/update_pythons.py @@ -93,7 +93,7 @@ class WindowsVersions: unsorted_versions = spec.filter(self.version_dict) versions = sorted(unsorted_versions, reverse=True) - log.debug(f"Windows {self.arch} {spec} has {', '.join(str(v) for v in versions)}") + log.debug("Windows %s %s has %s", self.arch, spec, ", ".join(str(v) for v in versions)) if not versions: return None @@ -254,7 +254,7 @@ class AllVersions: identifier = config["identifier"] version = Version(config["version"]) spec = Specifier(f"=={version.major}.{version.minor}.*") - log.info(f"Reading in '{identifier}' -> {spec} @ {version}") + log.info("Reading in %r -> %s @ %s", str(identifier), spec, version) orig_config = copy.copy(config) config_update: AnyConfig | None = None @@ -282,7 +282,7 @@ class AllVersions: config.update(**config_update) if config != orig_config: - log.info(f" Updated {orig_config} to {config}") + log.info(" Updated %s to %s", orig_config, config) @click.command() diff --git a/bin/update_virtualenv.py b/bin/update_virtualenv.py index ef1fec80..d7c7dc8a 100755 --- a/bin/update_virtualenv.py +++ b/bin/update_virtualenv.py @@ -54,14 +54,14 @@ def git_ls_remote_versions(url) -> list[VersionTuple]: try: version = Version(version_string) if version.is_devrelease: - log.info(f"Ignoring development release '{version}'") + log.info("Ignoring development release %r", str(version)) continue if version.is_prerelease: - log.info(f"Ignoring pre-release '{version}'") + log.info("Ignoring pre-release %r", str(version)) continue versions.append(VersionTuple(version, version_string)) except InvalidVersion: - log.warning(f"Ignoring ref '{ref}'") + log.warning("Ignoring ref %r", ref) versions.sort(reverse=True) return versions diff --git a/pyproject.toml b/pyproject.toml index 0234b137..c71a1ae4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,7 @@ select = [ "EM", # flake8-errmsg "ICN", # flake8-import-conventions "ISC", # flake8-implicit-str-concat + "G", # flake8-logging-format "PGH", # pygrep-hooks "PIE", # flake8-pie "PL", # pylint