Skip to content

build: check the core and source layers in pyright's strict mode - #47

Merged
nichinichisou0609 merged 1 commit into
mainfrom
build/pyright-strict
Oct 14, 2026
Merged

nichinichisou0609 merged 1 commit into
mainfrom
build/pyright-strict

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Collaborator

Summary

  • core, source and schemas are type-checked in pyright's strict mode ([tool.pyright] strict in pyproject.toml); the other subpackages stay in basic mode.
  • Every function of these layers is annotated: catalog locations, JP sources and clients, setting values (configfile.Value), cache settings (cache.Settings) and master downloads.
  • core.jsonio.is_object / is_array narrow decoded JSON values.

Checks

  • pyright: 0 errors (strict over core/source/schemas, basic elsewhere)
  • ruff check ., ruff format --check ., lint-imports
  • pytest: all pass
  • mkdocs build --strict

pyproject.toml lists core, source and schemas as strict paths; the rest
of the package stays in basic mode.

The modules of these layers are fully annotated:
- addressables: catalog locations are typed as `Location` records;
  `relative_path` takes and returns strings.
- catalog and jp: the JP source and client are typed, and
  `jp.open_catalog` documents what it opens.
- config and configfile: setting values are strings or lists of
  strings (`configfile.Value`); the prompt takes typed callables.
- cache: the settings are a `Settings` typed dictionary and buckets
  store `(value, size)` pairs.
- jsonio: `is_object` and `is_array` narrow decoded JSON values.
- master: `download` takes a typed fetch function.

Leaving an ApkSet's `with` block returns None: the archives it closes
never suppress an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nichinichisou0609
nichinichisou0609 merged commit dcfe397 into main Oct 14, 2026
8 checks passed
@nichinichisou0609
nichinichisou0609 deleted the build/pyright-strict branch October 14, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant