Skip to content

Commit

Permalink
feat: mise format (#3461)
Browse files Browse the repository at this point in the history
* feat: `mise format`

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
jdx and autofix-ci[bot] authored Dec 11, 2024
1 parent 507ee27 commit 6c28f1f
Show file tree
Hide file tree
Showing 10 changed files with 258 additions and 10 deletions.
148 changes: 138 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ siphasher = "1"
strum = { version = "0.26", features = ["derive"] }
sys-info = "0.9"
tabled = { version = "0.17", features = ["ansi"] }
taplo = "0.13"
tar = "0.4"
tempfile = "3"
tera = "1"
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/cli_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export const commands: { [key: string]: Command } = {
exec: {
hide: false,
},
format: {
hide: false,
},
generate: {
hide: false,
subcommands: {
Expand Down
17 changes: 17 additions & 0 deletions docs/cli/format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# `mise format`

- **Usage**: `mise format [-a --all]`
- **Aliases**: `fmt`
- **Source code**: [`src/cli/format.rs`](https://github.com/jdx/mise/blob/main/src/cli/format.rs)

Formats mise.toml

## Flags

### `-a --all`

Format all files from the current directory

Examples:

mise format
1 change: 1 addition & 0 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Answer yes to all confirmation prompts
- [`mise en [-s --shell <SHELL>] [DIR]`](/cli/en.md)
- [`mise env [FLAGS] [TOOL@VERSION]...`](/cli/env.md)
- [`mise exec [FLAGS] [TOOL@VERSION]... [COMMAND]...`](/cli/exec.md)
- [`mise format [-a --all]`](/cli/format.md)
- [`mise generate <SUBCOMMAND>`](/cli/generate.md)
- [`mise generate git-pre-commit [FLAGS]`](/cli/generate/git-pre-commit.md)
- [`mise generate github-action [FLAGS]`](/cli/generate/github-action.md)
Expand Down
3 changes: 3 additions & 0 deletions man/man1/mise.1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ Exports env vars to activate mise a single time
mise\-exec(1)
Execute a command with tool(s) set
.TP
mise\-format(1)
Formats mise.toml
.TP
mise\-generate(1)
[experimental] Generate files for various tools/services
.TP
Expand Down
8 changes: 8 additions & 0 deletions mise.usage.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,14 @@ The "--" separates runtimes from the commands to pass along to the subprocess."#
arg "[TOOL@VERSION]..." help="Tool(s) to start e.g.: node@20 [email protected]" var=true
arg "[COMMAND]..." help="Command string to execute (same as --command)" var=true
}
cmd "format" help="Formats mise.toml" {
alias "fmt"
after_long_help r"Examples:

$ mise format
"
flag "-a --all" help="Format all files from the current directory"
}
cmd "generate" subcommand_required=true help="[experimental] Generate files for various tools/services" {
alias "gen"
alias "g" hide=true
Expand Down
Loading

0 comments on commit 6c28f1f

Please sign in to comment.