schemas/README.md
This directory contains JSON Schema definitions for Pyrefly configuration files.
JSON Schema for pyrefly.toml configuration files. This schema provides validation, autocomplete, and documentation for all Pyrefly configuration options when editing pyrefly.toml files.
Schema URL: https://pyrefly.org/schemas/pyrefly.json
JSON Schema for the [tool.pyrefly] section in pyproject.toml files. This schema provides the same validation and autocomplete features as the pyrefly.json schema, but formatted for use within pyproject.toml files.
Schema URL: https://pyrefly.org/schemas/pyproject-tool-pyrefly.json
VS Code will automatically detect and use these schemas when you have the appropriate extensions installed:
For pyrefly.toml files:
settings.json:{
"evenBetterToml.schema.associations": {
"pyrefly.toml": "https://pyrefly.org/schemas/pyrefly.json"
}
}
For pyproject.toml files:
[tool.pyrefly] sectionsPyCharm automatically recognizes TOML schemas. You can configure schema mappings in:
Most modern editors with TOML support can use JSON Schemas. Consult your editor's documentation for configuring custom schema mappings.
During development, you can reference the local schema files:
For pyrefly.toml:
Add a comment at the top of your pyrefly.toml:
# yaml-language-server: $schema=./schemas/pyrefly.json
For pyproject.toml:
Add a comment in the [tool.pyrefly] section:
[tool.pyrefly]
# yaml-language-server: $schema=./schemas/pyproject-tool-pyrefly.json
The schemas provide:
python-platform or untyped-def-behavior) are validWhen adding new configuration options to Pyrefly:
crates/pyrefly_config/website/docs/configuration.mdxThese schemas can be submitted to SchemaStore to provide automatic validation in all compatible editors without manual configuration.
To submit:
src/schemas/json/ directorysrc/api/json/catalog.json to register the schemasFor more information, see the SchemaStore contribution guide.