diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07b7bbe8628..0b25a70b1cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,10 +4,7 @@ repos: rev: 'v3.5.3' hooks: - id: 'prettier' - # TODO: Add 'jsonc' so 'src/schema-validation.jsonc' is checked in CI - # Error: "Type tag 'jsonc' is not recognized. Try upgrading identify and pre-commit?" - types_or: ['yaml', 'json', 'javascript', 'css', 'markdown'] - always_run: true + types: [text] additional_dependencies: - 'prettier@3.5.2' - 'prettier-plugin-sort-json@4.0.0' @@ -15,9 +12,8 @@ repos: pass_filenames: true args: [ - '--no-color', '--log-level=warn', - '--write', + '--check', '--config=.prettierrc.cjs', '--ignore-path=.gitignore', ] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4854c730a64..a670ae3abc4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -313,6 +313,14 @@ Used by: `tamasfe/taplo`. Used by: `tombi-toml/tombi`. +**`x-tombi-array-values-order`** + +Used by: `tombi-toml/tombi`. + +**`x-tombi-table-keys-order`** + +Used by: `tombi-toml/tombi`. + **`x-intellij-language-injection`** Used by Intellij. diff --git a/src/schemas/json/partial-pytest.json b/src/schemas/json/partial-pytest.json index ff80b272f6a..304c878de50 100644 --- a/src/schemas/json/partial-pytest.json +++ b/src/schemas/json/partial-pytest.json @@ -25,10 +25,17 @@ "type": "object", "properties": { "addopts": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Extra command line options to be added by default.", "x-tombi-array-values-order": "ascending" }, @@ -58,10 +65,17 @@ "description": "Sets default encoding for doctest files." }, "doctest_optionflags": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Specifies doctest flag names from the `doctest` module.", "x-tombi-array-values-order": "ascending" }, @@ -76,10 +90,17 @@ "description": "Sets timeout in seconds for dumping the traceback of all threads if a test takes too long." }, "filterwarnings": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Sets action to take for matching warnings. Each item is a warning specification string.", "x-tombi-array-values-order": "ascending" }, @@ -173,10 +194,17 @@ "description": "Sets minimum log level for captured logging. Can be level name or integer value." }, "markers": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Allows registering additional markers for test functions.", "x-tombi-array-values-order": "ascending" }, @@ -200,10 +228,17 @@ "x-tombi-array-values-order": "ascending" }, "python_classes": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Specifies name prefixes or glob patterns for identifying test classes.", "x-tombi-array-values-order": "ascending" }, @@ -224,35 +259,63 @@ "x-tombi-array-values-order": "ascending" }, "python_functions": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Specifies name prefixes or glob patterns for identifying test functions and methods.", "default": ["test_*"], "x-tombi-array-values-order": "ascending" }, "pythonpath": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Sets list of directories to be added to the Python search path. Paths are relative to root directory.", "x-tombi-array-values-order": "ascending" }, "required_plugins": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Space-separated list of plugins required to run pytest. Can include version specifiers.", "x-tombi-array-values-order": "ascending" }, "testpaths": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "Sets directories to search for tests when no specific paths are given on the command line. Paths are relative to root directory. Shell-style wildcards can be used.", "x-tombi-array-values-order": "ascending" }, @@ -268,10 +331,17 @@ "default": "all" }, "usefixtures": { - "type": "array", - "items": { - "type": "string" - }, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], "description": "List of fixtures that will be applied to all test functions.", "x-tombi-array-values-order": "ascending" },