Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: (\.(svg|png|pdf)$)|(CODE_OF_CONDUCT.md)

- repo: https://github.com/numpy/numpydoc
rev: v1.10.0
rev: v1.11.0
hooks:
- id: numpydoc-validation
exclude: (tests|docs)/.*
Expand All @@ -38,14 +38,14 @@ repos:
files: tests/.*

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.21
rev: v0.16.10
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.25.2
rev: v2.30.0
hooks:
- id: pyproject-fmt
args: [--keep-full-version, --no-print-diff]
30 changes: 11 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ name = "ast-explore"
version = "0.2.1"
description = "Tool for exploring the AST of given Python source code."
readme = "README.md"
keywords = [
"ast",
"ast explainer",
"ast explorer",
"ast viewer",
]
keywords = [ "ast", "ast explainer", "ast explorer", "ast viewer" ]
license = { file = "LICENSE" }
authors = [
{ name = "Stefanie Molin", email = "ast-explore@stefaniemolin.com" },
]
authors = [ { name = "Stefanie Molin", email = "ast-explore@stefaniemolin.com" } ]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -27,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
]
dependencies = []
urls.Documentation = "https://github.com/stefmolin/ast-explore"
Expand All @@ -35,10 +29,7 @@ urls.Source = "https://github.com/stefmolin/ast-explore"
scripts.ast-explore = "ast_explore.cli:main"

[dependency-groups]
dev = [
"mypy>=2.2.0",
"pre-commit>=4.6.0",
]
dev = [ "mypy>=2.3.0", "pre-commit>=4.6.0" ]

[tool.ruff]
line-length = 88
Expand Down Expand Up @@ -74,10 +65,9 @@ lint.ignore = [
"E501", # line-too-long
"TRY003", # raise-vanilla-args
]
lint.extend-per-file-ignores."tests/*" = [ "ANN" ] # don't require annotations for tests
lint.isort.known-first-party = [
"ezslides",
]
lint.extend-per-file-ignores."tests/*" = [
"ANN",
] # don't require annotations for tests
lint.isort.split-on-trailing-comma = false

[tool.mypy]
Expand All @@ -93,12 +83,14 @@ checks = [
"SA01", # or a see also section
"SS06", # and don't require the summary to fit on one line
]
exclude = [ # don't report on checks for these
exclude = [
# don't report on checks for these
"\\.__init__$",
"\\.__repr__$",
"\\.__str__$",
]
override_SS05 = [ # allow docstrings to start with these words
override_SS05 = [
# allow docstrings to start with these words
"^Process ",
"^Assess ",
"^Access ",
Expand Down
6 changes: 3 additions & 3 deletions src/ast_explore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ def ast_node_types_generator() -> Iterator[str]:
Iterator[str]
Names of each of the AST node types.
"""
seen = set()
seen: set[type[ast.AST]] = set()

def subclass_generator(base_class: type) -> Iterator[str]:
def subclass_generator(base_class: type[ast.AST]) -> Iterator[str]:
"""
Generator for getting the names of all of a class's subclasses recursively.

Parameters
----------
base_class : type
base_class : type[ast.AST]
The class for which to grab all subclasses.

Yields
Expand Down
Loading
Loading