From 83f69bc703e27fc7d73400261cb72e1480ff5530 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Wed, 16 Aug 2023 17:04:19 +0100 Subject: [PATCH] A few ruff fixes --- pyproject.toml | 7 ++++++- src/typeshed_stats/serialize.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 31f246be..9ae56ccb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,7 +121,12 @@ unfixable = [ "F602", # automatic fix might obscure issue "B018", # automatic fix might obscure issue ] -per-file-ignores = {"tests/*.py" = ["D"]} + +[tool.ruff.per-file-ignores] +"tests/*.py" = [ + "D", # Don't need docstrings in test methods + "E721" # Asserting exact types is desirable in tests; E721 doesn't make sense +] [tool.ruff.pydocstyle] convention = "google" diff --git a/src/typeshed_stats/serialize.py b/src/typeshed_stats/serialize.py index 987e6f1d..77148ebe 100644 --- a/src/typeshed_stats/serialize.py +++ b/src/typeshed_stats/serialize.py @@ -237,7 +237,7 @@ def format_package(package_stats: PackageInfo) -> str: del kwargs["stubtest_settings"] kwargs = { - key: (f"{val:,}" if type(val) is int else val) + key: (f"{val:,}" if isinstance(val, int) else val) for key, val in kwargs.items() }