Skip to content

Commit

Permalink
fix: deprecated attribute in json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 11, 2024
1 parent 6e02eab commit 7a76062
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 35 deletions.
64 changes: 32 additions & 32 deletions schema/mise.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$id": "https://mise.jdx.dev/schema/mise.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "http://json-schema.org/2019-09/schema#",
"title": "mise",
"type": "object",
"$defs": {
Expand Down Expand Up @@ -148,8 +148,8 @@
},
"asdf": {
"description": "use asdf as a default plugin backend",
"deprecated": "Use disable_backends instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"asdf_compat": {
"description": "set to true to ensure .tool-versions will be compatible with asdf",
Expand Down Expand Up @@ -215,8 +215,8 @@
},
"disable_default_shorthands": {
"description": "Disables built-in shorthands to asdf/vfox plugins",
"deprecated": "Replaced with `disable_default_registry`",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"disable_hints": {
"default": [],
Expand Down Expand Up @@ -299,8 +299,8 @@
},
"go_set_gopath": {
"description": "[deprecated] Set to true to set GOPATH=~/.local/share/mise/installs/go/.../packages.",
"deprecated": "Use env._go.set_goroot instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"go_set_goroot": {
"default": true,
Expand Down Expand Up @@ -345,14 +345,14 @@
"legacy_version_file": {
"default": true,
"description": "Set to false to disable the idiomatic version files such as .node-version, .ruby-version, etc.",
"deprecated": "Use idiomatic_version_file instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"legacy_version_file_disable_tools": {
"default": [],
"description": "Specific tools to disable idiomatic version files for.",
"deprecated": "Use idiomatic_version_file_disable_tools instead.",
"type": "array",
"deprecated": true,
"items": {
"type": "string"
}
Expand Down Expand Up @@ -492,8 +492,8 @@
},
"venv_auto_create": {
"description": "Automatically create virtualenvs for python tools.",
"deprecated": "Use env._python.venv instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"venv_stdlib": {
"description": "Prefer to use venv from Python's standard library.",
Expand All @@ -503,48 +503,48 @@
},
"python_compile": {
"description": "If true, compile python from source. If false, use precompiled binaries. If not set, use precompiled binaries if available.",
"deprecated": "Use python.compile instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"python_default_packages_file": {
"description": "Path to a file containing default python packages to install when installing python.",
"deprecated": "Use python.default_packages_file instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_patch_url": {
"description": "URL to fetch python patches from.",
"deprecated": "Use python.patch_url instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_patches_directory": {
"description": "Directory to fetch python patches from.",
"deprecated": "Use python.patch_url instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_precompiled_arch": {
"description": "Specify the architecture to use for precompiled binaries.",
"deprecated": "Use python.precompiled_arch instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_precompiled_os": {
"description": "Specify the OS to use for precompiled binaries.",
"deprecated": "Use python.precompiled_os instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_pyenv_repo": {
"description": "URL to fetch pyenv from for compiling python.",
"deprecated": "Use python.pyenv_repo instead.",
"type": "string"
"type": "string",
"deprecated": true
},
"python_venv_auto_create": {
"description": "Automatically create virtualenvs for python tools.",
"deprecated": "Use env._python.venv instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"python_venv_stdlib": {
"description": "Prefer to use venv from Python's standard library.",
"deprecated": "Use python.venv_stdlib instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"quiet": {
"description": "Suppress all output except errors.",
Expand Down Expand Up @@ -710,8 +710,8 @@
},
"vfox": {
"description": "Use vfox as a default plugin backend instead of asdf.",
"deprecated": "Use disable_backends instead.",
"type": "boolean"
"type": "boolean",
"deprecated": true
},
"windows_default_file_shell_args": {
"default": "cmd /c",
Expand Down
11 changes: 8 additions & 3 deletions xtasks/render/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { match } from "ts-pattern";
type Element = {
default: string | number | boolean;
description: string;
deprecated: boolean;
deprecated?: boolean;
type: string;
enum?: string[];
items?: {
Expand All @@ -18,7 +18,7 @@ type Props = {
type: string;
default: string | number | boolean;
description: string;
deprecated: boolean;
deprecated: string;
enum?: [string][];
};

Expand Down Expand Up @@ -55,10 +55,12 @@ function buildElement(key: string, props: Props): Element {
const ele: Element = {
default: props.default,
description: props.description,
deprecated: props.deprecated,
type,
};

if (props.deprecated) {
ele.deprecated = true;
}
if (props.enum) {
ele.enum = props.enum.map((e) => e[0]);
}
Expand Down Expand Up @@ -87,6 +89,9 @@ for (const key in doc) {
description: props.description,
properties: {},
};
if (props.deprecated) {
settings[key].deprecated = true;
}
settings[key].properties[subkey] = buildElement(
`${key}.${subkey}`,
props[subkey],
Expand Down

0 comments on commit 7a76062

Please sign in to comment.