diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8cbc67fb..2401bd3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: name-tests-test args: [--pytest-test-first] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.280 # must match pyproject.toml + rev: v0.0.283 # must match pyproject.toml hooks: - id: ruff - repo: https://github.com/psf/black-pre-commit-mirror diff --git a/pyproject.toml b/pyproject.toml index 0d0d8887..9ae56ccb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,11 +52,12 @@ rich = ["rich", "rich-argparse>=1"] # so the CLI docs generated from --help are consistent docs = [ "typeshed-stats[rich]", - "MarkDown==3.3.7", - "mkdocs==1.4.3", - "mkdocs-macros-plugin==1.0.2", - "mkdocs-material==9.1.18", - "mkdocstrings[python]==0.22.0", + "MarkDown==3.4.4", + "mkdocs==1.5.2", + "mkdocs-macros-plugin==1.0.4", + "mkdocs-material==9.1.21", + "mkdocstrings==0.22.0", + "mkdocstrings-python==1.3.0", ] pytest = [ "typeshed-stats[rich]", @@ -75,7 +76,7 @@ typecheck = [ "typeshed-stats[rich,docs,pytest]", "mypy==1.4.1", "types-beautifulsoup4==4.12.0.5", - "types-Markdown==3.4.2.9", + "types-Markdown==3.4.2.10", ] # All of these must match .pre-commit-config.yaml # @@ -86,7 +87,7 @@ misc-lint = [ "black==23.7.0", "blacken-docs==1.15.0", "pre-commit-hooks==4.4.0", - "ruff==0.0.280", + "ruff==0.0.283", ] dev = ["typeshed-stats[rich,docs,typecheck,pytest,misc-lint]"] @@ -120,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() }