summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2022-04-01 17:14:05 +0200
committerGitHub <noreply@github.com>2022-04-01 17:14:05 +0200
commit18ad26f98dd1bfcc01e2b092a5b6165a7b093631 (patch)
tree10f55ccdfb49f12aae9fd8b03217579683b5a62d
parent418bac919087c692c8188744d951b50643c45f49 (diff)
feat: allow printing config file schema (#3737)
-rw-r--r--.gitattributes1
-rw-r--r--.github/config-schema.json4711
-rw-r--r--.github/workflows/workflow.yml25
-rw-r--r--CONTRIBUTING.md3
-rw-r--r--Cargo.lock43
-rw-r--r--Cargo.toml7
l---------docs/.vuepress/public/config-schema.json1
-rw-r--r--docs/config/README.md3
-rw-r--r--src/config.rs19
-rw-r--r--src/configs/aws.rs33
-rw-r--r--src/configs/azure.rs1
-rw-r--r--src/configs/battery.rs2
-rw-r--r--src/configs/buf.rs1
-rw-r--r--src/configs/c.rs1
-rw-r--r--src/configs/character.rs1
-rw-r--r--src/configs/cmake.rs1
-rw-r--r--src/configs/cmd_duration.rs1
-rw-r--r--src/configs/cobol.rs1
-rw-r--r--src/configs/conda.rs1
-rw-r--r--src/configs/container.rs1
-rw-r--r--src/configs/crystal.rs1
-rw-r--r--src/configs/custom.rs1
-rw-r--r--src/configs/dart.rs1
-rw-r--r--src/configs/deno.rs1
-rw-r--r--src/configs/directory.rs1
-rw-r--r--src/configs/docker_context.rs1
-rw-r--r--src/configs/dotnet.rs1
-rw-r--r--src/configs/elixir.rs1
-rw-r--r--src/configs/elm.rs1
-rw-r--r--src/configs/env_var.rs1
-rw-r--r--src/configs/erlang.rs1
-rw-r--r--src/configs/fill.rs1
-rw-r--r--src/configs/gcloud.rs1
-rw-r--r--src/configs/git_branch.rs1
-rw-r--r--src/configs/git_commit.rs1
-rw-r--r--src/configs/git_metrics.rs1
-rw-r--r--src/configs/git_state.rs1
-rw-r--r--src/configs/git_status.rs1
-rw-r--r--src/configs/go.rs1
-rw-r--r--src/configs/haskell.rs1
-rw-r--r--src/configs/helm.rs1
-rw-r--r--src/configs/hg_branch.rs1
-rw-r--r--src/configs/hostname.rs1
-rw-r--r--src/configs/java.rs1
-rw-r--r--src/configs/jobs.rs1
-rw-r--r--src/configs/julia.rs1
-rw-r--r--src/configs/kotlin.rs1
-rw-r--r--src/configs/kubernetes.rs1
-rw-r--r--src/configs/line_break.rs2
-rw-r--r--src/configs/localip.rs1
-rw-r--r--src/configs/lua.rs1
-rw-r--r--src/configs/memory_usage.rs1
-rw-r--r--src/configs/mod.rs4
-rw-r--r--src/configs/nim.rs1
-rw-r--r--src/configs/nix_shell.rs1
-rw-r--r--src/configs/nodejs.rs1
-rw-r--r--src/configs/ocaml.rs1
-rw-r--r--src/configs/openstack.rs1
-rw-r--r--src/configs/package.rs1
-rw-r--r--src/configs/perl.rs1
-rw-r--r--src/configs/php.rs1
-rw-r--r--src/configs/pulumi.rs1
-rw-r--r--src/configs/purescript.rs1
-rw-r--r--src/configs/python.rs1
-rw-r--r--src/configs/red.rs1
-rw-r--r--src/configs/rlang.rs1
-rw-r--r--src/configs/ruby.rs1
-rw-r--r--src/configs/rust.rs1
-rw-r--r--src/configs/scala.rs1
-rw-r--r--src/configs/shell.rs1
-rw-r--r--src/configs/shlvl.rs1
-rw-r--r--src/configs/singularity.rs1
-rw-r--r--src/configs/starship_root.rs4
-rw-r--r--src/configs/status.rs1
-rw-r--r--src/configs/sudo.rs1
-rw-r--r--src/configs/swift.rs1
-rw-r--r--src/configs/terraform.rs1
-rw-r--r--src/configs/time.rs1
-rw-r--r--src/configs/username.rs1
-rw-r--r--src/configs/v.rs1
-rw-r--r--src/configs/vagrant.rs1
-rw-r--r--src/configs/vcsh.rs1
-rw-r--r--src/configs/zig.rs1
-rw-r--r--src/main.rs5
-rw-r--r--src/print.rs12
85 files changed, 4944 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index 9f97ceaac..9c8e6abd6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,3 @@
/src/init/* text eol=lf
*.sh text eol=lf
+/.github/config-schema.json text eol=lf \ No newline at end of file
diff --git a/.github/config-schema.json b/.github/config-schema.json
new file mode 100644
index 000000000..8f24c71f7
--- /dev/null
+++ b/.github/config-schema.json
@@ -0,0 +1,4711 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "FullConfig",
+ "type": "object",
+ "properties": {
+ "$schema": {
+ "default": "https://starship.rs/config-schema.json",
+ "type": "string"
+ },
+ "aws": {
+ "default": {
+ "disabled": false,
+ "expiration_symbol": "X",
+ "force_display": false,
+ "format": "on [$symbol($profile )(\\($region\\) )(\\[$duration\\])]($style)",
+ "profile_aliases": {},
+ "region_aliases": {},
+ "style": "bold yellow",
+ "symbol": "☁️ "
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/AwsConfig"
+ }
+ ]
+ },
+ "azure": {
+ "default": {
+ "disabled": true,
+ "format": "on [$symbol($subscription)]($style) ",
+ "style": "blue bold",
+ "symbol": "ﴃ "
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/AzureConfig"
+ }
+ ]
+ },
+ "battery": {
+ "default": {
+ "charging_symbol": " ",
+ "disabled": false,
+ "discharging_symbol": " ",
+ "display": [
+ {
+ "charging_symbol": null,
+ "discharging_symbol": null,
+ "style": "red bold",
+ "threshold": 10
+ }
+ ],
+ "empty_symbol": " ",
+ "format": "[$symbol$percentage]($style) ",
+ "full_symbol": " ",
+ "unknown_symbol": " "
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/BatteryConfig"
+ }
+ ]
+ },
+ "buf": {
+ "default": {
+ "detect_extensions": [],
+ "detect_files": [
+ "buf.yaml",
+ "buf.gen.yaml",
+ "buf.work.yaml"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "with [$symbol ($version)]($style)",
+ "style": "bold blue",
+ "symbol": "",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/BufConfig"
+ }
+ ]
+ },
+ "c": {
+ "default": {
+ "commands": [
+ [
+ "cc",
+ "--version"
+ ],
+ [
+ "gcc",
+ "--version"
+ ],
+ [
+ "clang",
+ "--version"
+ ]
+ ],
+ "detect_extensions": [
+ "c",
+ "h"
+ ],
+ "detect_files": [],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version(-$name) )]($style)",
+ "style": "149 bold",
+ "symbol": "C ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CConfig"
+ }
+ ]
+ },
+ "character": {
+ "default": {
+ "disabled": false,
+ "error_symbol": "[❯](bold red)",
+ "format": "$symbol ",
+ "success_symbol": "[❯](bold green)",
+ "vicmd_symbol": "[❮](bold green)"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CharacterConfig"
+ }
+ ]
+ },
+ "cmake": {
+ "default": {
+ "detect_extensions": [],
+ "detect_files": [
+ "CMakeLists.txt",
+ "CMakeCache.txt"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "bold blue",
+ "symbol": "△ ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CMakeConfig"
+ }
+ ]
+ },
+ "cmd_duration": {
+ "default": {
+ "disabled": false,
+ "format": "took [$duration]($style) ",
+ "min_time": 2000,
+ "min_time_to_notify": 45000,
+ "show_milliseconds": false,
+ "show_notifications": false,
+ "style": "yellow bold"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CmdDurationConfig"
+ }
+ ]
+ },
+ "cobol": {
+ "default": {
+ "detect_extensions": [
+ "cbl",
+ "cob",
+ "CBL",
+ "COB"
+ ],
+ "detect_files": [],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "bold blue",
+ "symbol": "⚙️ ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CobolConfig"
+ }
+ ]
+ },
+ "conda": {
+ "default": {
+ "disabled": false,
+ "format": "via [$symbol$environment]($style) ",
+ "ignore_base": true,
+ "style": "green bold",
+ "symbol": "🅒 ",
+ "truncation_length": 1
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CondaConfig"
+ }
+ ]
+ },
+ "container": {
+ "default": {
+ "disabled": false,
+ "format": "[$symbol \\[$name\\]]($style) ",
+ "style": "red bold dimmed",
+ "symbol": "⬢"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/ContainerConfig"
+ }
+ ]
+ },
+ "crystal": {
+ "default": {
+ "detect_extensions": [
+ "cr"
+ ],
+ "detect_files": [
+ "shard.yml"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "bold red",
+ "symbol": "🔮 ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/CrystalConfig"
+ }
+ ]
+ },
+ "dart": {
+ "default": {
+ "detect_extensions": [
+ "dart"
+ ],
+ "detect_files": [
+ "pubspec.yaml",
+ "pubspec.yml",
+ "pubspec.lock"
+ ],
+ "detect_folders": [
+ ".dart_tool"
+ ],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "bold blue",
+ "symbol": "🎯 ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/DartConfig"
+ }
+ ]
+ },
+ "deno": {
+ "default": {
+ "detect_extensions": [],
+ "detect_files": [
+ "deno.json",
+ "deno.jsonc",
+ "mod.ts",
+ "deps.ts",
+ "mod.js",
+ "deps.js"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "green bold",
+ "symbol": "🦕 ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/DenoConfig"
+ }
+ ]
+ },
+ "directory": {
+ "default": {
+ "disabled": false,
+ "fish_style_pwd_dir_length": 0,
+ "format": "[$path]($style)[$read_only]($read_only_style) ",
+ "home_symbol": "~",
+ "read_only": "🔒",
+ "read_only_style": "red",
+ "repo_root_format": "[$before_root_path]($style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) ",
+ "repo_root_style": null,
+ "style": "cyan bold",
+ "substitutions": {},
+ "truncate_to_repo": true,
+ "truncation_length": 3,
+ "truncation_symbol": "",
+ "use_logical_path": true,
+ "use_os_path_sep": true
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/DirectoryConfig"
+ }
+ ]
+ },
+ "docker_context": {
+ "default": {
+ "detect_extensions": [],
+ "detect_files": [
+ "docker-compose.yml",
+ "docker-compose.yaml",
+ "Dockerfile"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol$context]($style) ",
+ "only_with_files": true,
+ "style": "blue bold",
+ "symbol": "🐳 "
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/DockerContextConfig"
+ }
+ ]
+ },
+ "dotnet": {
+ "default": {
+ "detect_extensions": [
+ "csproj",
+ "fsproj",
+ "xproj"
+ ],
+ "detect_files": [
+ "global.json",
+ "project.json",
+ "Directory.Build.props",
+ "Directory.Build.targets",
+ "Packages.props"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version )(🎯 $tfm )]($style)",
+ "heuristic": true,
+ "style": "blue bold",
+ "symbol": ".NET ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/DotnetConfig"
+ }
+ ]
+ },
+ "elixir": {
+ "default": {
+ "detect_extensions": [],
+ "detect_files": [
+ "mix.exs"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version \\(OTP $otp_version\\) )]($style)",
+ "style": "bold purple",
+ "symbol": "💧 ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/ElixirConfig"
+ }
+ ]
+ },
+ "elm": {
+ "default": {
+ "detect_extensions": [
+ "elm"
+ ],
+ "detect_files": [
+ "elm.json",
+ "elm-package.json",
+ ".elm-version"
+ ],
+ "detect_folders": [
+ "elm-stuff"
+ ],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "cyan bold",
+ "symbol": "🌳 ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/ElmConfig"
+ }
+ ]
+ },
+ "env_var": {
+ "default": {},
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/EnvVarConfig"
+ }
+ },
+ "erlang": {
+ "default": {
+ "detect_extensions": [],
+ "detect_files": [
+ "rebar.config",
+ "erlang.mk"
+ ],
+ "detect_folders": [],
+ "disabled": false,
+ "format": "via [$symbol($version )]($style)",
+ "style": "bold red",
+ "symbol": " ",
+ "version_format": "v${raw}"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/ErlangConfig"
+ }
+ ]
+ },
+ "fill": {
+ "default": {
+ "disabled": false,
+ "style": "bold black",
+ "symbol": "."
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/FillConfig"
+ }
+ ]
+ },
+ "gcloud": {
+ "default": {
+ "disabled": false,
+ "format": "on [$symbol$account(@$domain)(\\($region\\))]($style) ",
+ "project_aliases": {},
+ "region_aliases": {},
+ "style": "bold blue",
+ "symbol": "☁️ "
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/GcloudConfig"
+ }
+ ]
+ },
+ "git_branch": {
+ "default": {
+ "always_show_remote": false,
+ "disabled": false,
+ "format": "on [$symbol$branch]($style)(:[$remote]($style)) ",
+ "ignore_branches": [],
+ "only_attached": false,
+ "style": "bold purple",
+ "symbol": " ",
+ "truncation_length": 9223372036854775807,
+ "truncation_symbol": "…"
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/GitBranchConfig"
+ }
+ ]
+ },
+ "git_commit": {
+ "default": {
+ "commit_hash_length": 7,
+ "disabled": false,
+ "format": "[\\($hash$tag\\)]($style) ",
+ "only_detached": true,
+ "style": "green bold",
+ "tag_disabled": true,
+ "tag_symbol": " 🏷 "
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/GitCommitConfig"
+ }
+ ]
+ },
+ "git_metrics": {
+ "default": {
+ "added_style": "bold green",
+ "deleted_style": "bold red",
+ "disabled": true,
+ "format": "([+$added]($added_style) )([-$deleted]($deleted_style) )",
+ "only_nonzero_diffs": true
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/GitMetricsConfig"
+ }
+ ]
+ },
+ "git_state": {
+ "default": {
+ "am": "AM",
+ "am_or_rebase": "AM/REBASE",
+ "bisect": "BISECTING",
+ "cherry_pick": "CHERRY-PICKING",
+ "disabled": false,
+ "format": "\\([$state( $progress_current/$progress_total)]($style)\\) ",
+ "merge": "MERGING",
+ "rebase": "REBASING",
+ "revert": "REVERTING",