diff --git a/Cargo.lock b/Cargo.lock index 69966c31..8a88930a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -251,7 +251,7 @@ dependencies = [ [[package]] name = "mdsf" -version = "0.0.0" +version = "0.0.1" dependencies = [ "clap", "ignore", diff --git a/Cargo.toml b/Cargo.toml index a9bf2662..688a7960 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mdsf" -version = "0.0.0" +version = "0.0.1" edition = "2021" description = "Format markdown code snippets using your favorite code formatters" authors = ["Mads Hougesen "] diff --git a/schemas/v0.0.0/mdsf.schema.json b/schemas/v0.0.0/mdsf.schema.json index e650e020..d93efe89 100644 --- a/schemas/v0.0.0/mdsf.schema.json +++ b/schemas/v0.0.0/mdsf.schema.json @@ -25,17 +25,6 @@ } ] }, - "crystal": { - "default": { - "enabled": true, - "formatter": "crystal_format" - }, - "allOf": [ - { - "$ref": "#/definitions/Crystal" - } - ] - }, "csharp": { "default": { "enabled": true, @@ -212,17 +201,6 @@ } ] }, - "roc": { - "default": { - "enabled": true, - "formatter": "roc_format" - }, - "allOf": [ - { - "$ref": "#/definitions/Roc" - } - ] - }, "ruby": { "default": { "enabled": true, @@ -387,27 +365,6 @@ "type": "string", "enum": ["clang-format"] }, - "Crystal": { - "type": "object", - "properties": { - "enabled": { - "default": true, - "type": "boolean" - }, - "formatter": { - "default": "crystal_format", - "allOf": [ - { - "$ref": "#/definitions/CrystalFormatter" - } - ] - } - } - }, - "CrystalFormatter": { - "type": "string", - "enum": ["crystal_format"] - }, "Css": { "type": "object", "properties": { @@ -723,27 +680,6 @@ "type": "string", "enum": ["ruff", "black", "yapf", "blue", "autopep8"] }, - "Roc": { - "type": "object", - "properties": { - "enabled": { - "default": true, - "type": "boolean" - }, - "formatter": { - "default": "roc_format", - "allOf": [ - { - "$ref": "#/definitions/RocFormatter" - } - ] - } - } - }, - "RocFormatter": { - "type": "string", - "enum": ["roc_format"] - }, "Ruby": { "type": "object", "properties": { diff --git a/schemas/v0.0.1/mdsf.schema.json b/schemas/v0.0.1/mdsf.schema.json new file mode 100644 index 00000000..e650e020 --- /dev/null +++ b/schemas/v0.0.1/mdsf.schema.json @@ -0,0 +1,937 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MdsfConfig", + "type": "object", + "properties": { + "c": { + "default": { + "enabled": true, + "formatter": "clang-format" + }, + "allOf": [ + { + "$ref": "#/definitions/C" + } + ] + }, + "cpp": { + "default": { + "enabled": true, + "formatter": "clang-format" + }, + "allOf": [ + { + "$ref": "#/definitions/Cpp" + } + ] + }, + "crystal": { + "default": { + "enabled": true, + "formatter": "crystal_format" + }, + "allOf": [ + { + "$ref": "#/definitions/Crystal" + } + ] + }, + "csharp": { + "default": { + "enabled": true, + "formatter": "clang-format" + }, + "allOf": [ + { + "$ref": "#/definitions/CSharp" + } + ] + }, + "css": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/Css" + } + ] + }, + "dart": { + "default": { + "enabled": true, + "formatter": "dart_format" + }, + "allOf": [ + { + "$ref": "#/definitions/Dart" + } + ] + }, + "elixir": { + "default": { + "enabled": true, + "formatter": "mix_format" + }, + "allOf": [ + { + "$ref": "#/definitions/Elixir" + } + ] + }, + "gleam": { + "default": { + "enabled": true, + "formatter": "gleam_format" + }, + "allOf": [ + { + "$ref": "#/definitions/Gleam" + } + ] + }, + "go": { + "default": { + "enabled": true, + "formatter": "gofmt" + }, + "allOf": [ + { + "$ref": "#/definitions/Go" + } + ] + }, + "html": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/Html" + } + ] + }, + "java": { + "default": { + "enabled": true, + "formatter": "clang-format" + }, + "allOf": [ + { + "$ref": "#/definitions/Java" + } + ] + }, + "javascript": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/JavaScript" + } + ] + }, + "json": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/Json" + } + ] + }, + "lua": { + "default": { + "enabled": true, + "formatter": "stylua" + }, + "allOf": [ + { + "$ref": "#/definitions/Lua" + } + ] + }, + "markdown": { + "default": { + "enabled": false, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/Markdown" + } + ] + }, + "nim": { + "default": { + "enabled": true, + "formatter": "nimpretty" + }, + "allOf": [ + { + "$ref": "#/definitions/Nim" + } + ] + }, + "objective_c": { + "default": { + "enabled": true, + "formatter": "clang-format" + }, + "allOf": [ + { + "$ref": "#/definitions/ObjectiveC" + } + ] + }, + "protobuf": { + "default": { + "enabled": true, + "formatter": "clang-format" + }, + "allOf": [ + { + "$ref": "#/definitions/Protobuf" + } + ] + }, + "python": { + "default": { + "enabled": true, + "formatter": "ruff" + }, + "allOf": [ + { + "$ref": "#/definitions/Python" + } + ] + }, + "roc": { + "default": { + "enabled": true, + "formatter": "roc_format" + }, + "allOf": [ + { + "$ref": "#/definitions/Roc" + } + ] + }, + "ruby": { + "default": { + "enabled": true, + "formatter": "rubocop" + }, + "allOf": [ + { + "$ref": "#/definitions/Ruby" + } + ] + }, + "rust": { + "default": { + "enabled": true, + "formatter": "rustfmt" + }, + "allOf": [ + { + "$ref": "#/definitions/Rust" + } + ] + }, + "shell": { + "default": { + "enabled": true, + "formatter": "shfmt" + }, + "allOf": [ + { + "$ref": "#/definitions/Shell" + } + ] + }, + "sql": { + "default": { + "enabled": true, + "formatter": "sqlfluff" + }, + "allOf": [ + { + "$ref": "#/definitions/Sql" + } + ] + }, + "toml": { + "default": { + "enabled": true, + "formatter": "taplo" + }, + "allOf": [ + { + "$ref": "#/definitions/Toml" + } + ] + }, + "typescript": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/TypeScript" + } + ] + }, + "vue": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/Vue" + } + ] + }, + "yaml": { + "default": { + "enabled": true, + "formatter": "prettier" + }, + "allOf": [ + { + "$ref": "#/definitions/Yaml" + } + ] + }, + "zig": { + "default": { + "enabled": true, + "formatter": "zigfmt" + }, + "allOf": [ + { + "$ref": "#/definitions/Zig" + } + ] + } + }, + "definitions": { + "C": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "clang-format", + "allOf": [ + { + "$ref": "#/definitions/CFormatter" + } + ] + } + } + }, + "CFormatter": { + "type": "string", + "enum": ["clang-format"] + }, + "CSharp": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "clang-format", + "allOf": [ + { + "$ref": "#/definitions/CSharpFormatter" + } + ] + } + } + }, + "CSharpFormatter": { + "type": "string", + "enum": ["clang-format"] + }, + "Cpp": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "clang-format", + "allOf": [ + { + "$ref": "#/definitions/CppFormatter" + } + ] + } + } + }, + "CppFormatter": { + "type": "string", + "enum": ["clang-format"] + }, + "Crystal": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "crystal_format", + "allOf": [ + { + "$ref": "#/definitions/CrystalFormatter" + } + ] + } + } + }, + "CrystalFormatter": { + "type": "string", + "enum": ["crystal_format"] + }, + "Css": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/CssFormatter" + } + ] + } + } + }, + "CssFormatter": { + "type": "string", + "enum": ["prettier"] + }, + "Dart": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "dart_format", + "allOf": [ + { + "$ref": "#/definitions/DartFormatter" + } + ] + } + } + }, + "DartFormatter": { + "type": "string", + "enum": ["dart_format"] + }, + "Elixir": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "mix_format", + "allOf": [ + { + "$ref": "#/definitions/ElixirFormatter" + } + ] + } + } + }, + "ElixirFormatter": { + "type": "string", + "enum": ["mix_format"] + }, + "Gleam": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "gleam_format", + "allOf": [ + { + "$ref": "#/definitions/GleamFormatter" + } + ] + } + } + }, + "GleamFormatter": { + "type": "string", + "enum": ["gleam_format"] + }, + "Go": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "gofmt", + "allOf": [ + { + "$ref": "#/definitions/GoFormatter" + } + ] + } + } + }, + "GoFormatter": { + "type": "string", + "enum": ["gofmt", "gofumpt"] + }, + "Html": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/HtmlFormatter" + } + ] + } + } + }, + "HtmlFormatter": { + "type": "string", + "enum": ["prettier"] + }, + "Java": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "clang-format", + "allOf": [ + { + "$ref": "#/definitions/JavaFormatter" + } + ] + } + } + }, + "JavaFormatter": { + "type": "string", + "enum": ["clang-format"] + }, + "JavaScript": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/JavaScriptFormatter" + } + ] + } + } + }, + "JavaScriptFormatter": { + "type": "string", + "enum": ["prettier", "biome", "clang-format"] + }, + "Json": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/JsonFormatter" + } + ] + } + } + }, + "JsonFormatter": { + "type": "string", + "enum": ["prettier", "biome", "clang-format"] + }, + "Lua": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "stylua", + "allOf": [ + { + "$ref": "#/definitions/LuaFormatter" + } + ] + } + } + }, + "LuaFormatter": { + "type": "string", + "enum": ["stylua"] + }, + "Markdown": { + "type": "object", + "properties": { + "enabled": { + "default": false, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/MarkdownFormatter" + } + ] + } + } + }, + "MarkdownFormatter": { + "type": "string", + "enum": ["prettier"] + }, + "Nim": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "nimpretty", + "allOf": [ + { + "$ref": "#/definitions/NimFormatter" + } + ] + } + } + }, + "NimFormatter": { + "type": "string", + "enum": ["nimpretty"] + }, + "ObjectiveC": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "clang-format", + "allOf": [ + { + "$ref": "#/definitions/ObjectiveCFormatter" + } + ] + } + } + }, + "ObjectiveCFormatter": { + "type": "string", + "enum": ["clang-format"] + }, + "Protobuf": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "clang-format", + "allOf": [ + { + "$ref": "#/definitions/ProtobufFormatter" + } + ] + } + } + }, + "ProtobufFormatter": { + "type": "string", + "enum": ["clang-format"] + }, + "Python": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "ruff", + "allOf": [ + { + "$ref": "#/definitions/PythonFormatter" + } + ] + } + } + }, + "PythonFormatter": { + "type": "string", + "enum": ["ruff", "black", "yapf", "blue", "autopep8"] + }, + "Roc": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "roc_format", + "allOf": [ + { + "$ref": "#/definitions/RocFormatter" + } + ] + } + } + }, + "RocFormatter": { + "type": "string", + "enum": ["roc_format"] + }, + "Ruby": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "rubocop", + "allOf": [ + { + "$ref": "#/definitions/RubyFormatter" + } + ] + } + } + }, + "RubyFormatter": { + "type": "string", + "enum": ["rubocop"] + }, + "Rust": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "rustfmt", + "allOf": [ + { + "$ref": "#/definitions/RustFormatter" + } + ] + } + } + }, + "RustFormatter": { + "type": "string", + "enum": ["rustfmt"] + }, + "Shell": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "shfmt", + "allOf": [ + { + "$ref": "#/definitions/ShellFormatter" + } + ] + } + } + }, + "ShellFormatter": { + "type": "string", + "enum": ["shfmt"] + }, + "Sql": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "sqlfluff", + "allOf": [ + { + "$ref": "#/definitions/SqlFormatter" + } + ] + } + } + }, + "SqlFormatter": { + "type": "string", + "enum": ["sqlfluff", "sql-formatter"] + }, + "Toml": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "taplo", + "allOf": [ + { + "$ref": "#/definitions/TomlFormatter" + } + ] + } + } + }, + "TomlFormatter": { + "type": "string", + "enum": ["taplo"] + }, + "TypeScript": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/TypeScriptFormatter" + } + ] + } + } + }, + "TypeScriptFormatter": { + "type": "string", + "enum": ["prettier", "biome"] + }, + "Vue": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/VueFormatter" + } + ] + } + } + }, + "VueFormatter": { + "type": "string", + "enum": ["prettier"] + }, + "Yaml": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "prettier", + "allOf": [ + { + "$ref": "#/definitions/YamlFormatter" + } + ] + } + } + }, + "YamlFormatter": { + "type": "string", + "enum": ["prettier"] + }, + "Zig": { + "type": "object", + "properties": { + "enabled": { + "default": true, + "type": "boolean" + }, + "formatter": { + "default": "zigfmt", + "allOf": [ + { + "$ref": "#/definitions/ZigFormatter" + } + ] + } + } + }, + "ZigFormatter": { + "type": "string", + "enum": ["zigfmt"] + } + } +}