Add schema for docstring-format-checker#5309
Add schema for docstring-format-checker#5309chrimaho wants to merge 5 commits intoSchemaStore:masterfrom
docstring-format-checker#5309Conversation
- Introduce `partial-dfc.json` schema for the `docstring-format-checker` package. - Reference the new schema in `pyproject.json` under `dfc` and `docstring-format-checker`. - Provide detailed properties for configuration options in the schema.
|
Thanks! I can merge this once CI goes green; |
- Improve formatting and readability of the JSON schema. - Correct indentation.
- Introduce schema for `docstring-format-checker` with description and URL. - Introduce schema for `dfc` with description and URL.
- Resolving failing `ajv` validation checks:
- Error message:
- `strict mode: use allowUnionTypes to allow union type keyword at "https://json.schemastore.org/partial-dfc.json#/properties/sections/items/properties/admonition" (strictTypes)`
- This means Ajv validation doesn't allow union types (e.g., `"type": ["boolean", "string"]`) by default under strict mode.
- Solution: Replace the union type definition for the "admonition" property with a `oneOf` clause.
- Here, the solution provides one of `"boolean"` with only the `false` value, or `"string"` otherwise.
|
Hi @hyperupcall, thanks for your message. The one that is remaining is the 'Ajv' check, which returns: Running "Ajv validation" on file "./src/schemas/json/pyproject.json"
✖
---
>> Failed to compile schema file "./src/schemas/json/pyproject.json"
---
Error: can't resolve reference https://json.schemastore.org/partial-dfc.json from id https://json.schemastore.org/pyproject.json
at Object.code (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/vocabularies/core/ref.js:21:19)
at keywordCode (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:464:13)
at /home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:185:25
at CodeGen.code (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/codegen/index.js:439:13)
at CodeGen.block (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/codegen/index.js:568:18)
at schemaKeywords (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:185:13)
at typeAndKeywords (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:128:5)
at subSchemaObjCode (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:115:5)
at subschemaCode (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:91:13)
at KeywordCxt.subschema (/home/runner/work/schemastore/schemastore/node_modules/ajv/dist/compile/validate/index.js:438:9)
Error: Process completed with exit code 1.It looks like the job is failing because the schema file Which makes sense, because that is exactly what this PR is looking to add. Once merged, then Can you please confirm that this is expected behaviour? Thank you. |
|
@chrimaho This error is expected, please see |
- Introduce schema entries for `dfc` and `docstring-format-checker` in the catalog. - Reorder entries for `docstring-format-checker` and `dfc`. - Add `partial-dfc.json` to the schema validation file match list. - Create a new configuration file for `docstring-format-checker`.
This pull request adds support for validating configuration of the
docstring-format-checkertool inpyproject.tomlby introducing a new JSON schema and integrating it into the overallpyproject.jsonschema. The main focus is on enabling schema validation for both[tool.dfc]and[tool.docstring-format-checker]sections.Schema integration for docstring-format-checker:
partial-dfc.jsonthat defines configuration options for thedocstring-format-checkertool, including properties likeallow_undefined_sections,require_docstrings,check_private,validate_param_types,optional_style, and a detailedsectionsarray for custom docstring section validation.pyproject.jsonto reference the newpartial-dfc.jsonschema under bothdfcanddocstring-format-checkerkeys, allowing users to configure the tool using either[tool.dfc]or[tool.docstring-format-checker]in theirpyproject.toml.