taplo icon indicating copy to clipboard operation
taplo copied to clipboard

`--no-schema` is ignored when schema directive is present

Open cdwilson opened this issue 6 months ago • 0 comments

I'm trying to use taplo lint --no-schema in pre-commit.ci where no network access is allowed at runtime.

Even though --no-schema is specified, it tries to look up the schema based on the directive in the file. I'm getting an error:

ERROR taplo:lint_files: invalid file error=failed to load schema https://json.schemastore.org/pyproject.json

My pyproject.toml has this directive:

#:schema https://json.schemastore.org/pyproject.json

If I remove this directive from pyproject.toml, the error goes away.

I would expect that --no-schema would take precedence over any #:schema directive in the file.

Is there a way to force taplo lint to run such that it does not make any network calls for external schema files?

cdwilson avatar Aug 21 '24 22:08 cdwilson