Skip to content

hougesen/mdsf

Repository files navigation

mdsf

Format markdown code snippets using your favorite code formatters.

Table of contents

Installation

The latest version of mdsf can be downloaded directly from github.com/hougesen/mdsf/releases.

Linux & MacOS

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hougesen/mdsf/releases/latest/download/mdsf-installer.sh | sh

Windows

powershell -ExecutionPolicy ByPass -c "irm https://github.com/hougesen/mdsf/releases/latest/download/mdsf-installer.ps1 | iex"

Cargo

Install using the published crate:

cargo install mdsf --locked

or directly from source:

git clone [email protected]:hougesen/mdsf.git

cargo install --path ./mdsf --bin mdsf

If you do not have Cargo installed, you need to install it first.

npm/npx

You can install mdsf using npm:

npm install -g mdsf-cli

mdsf format .

or run it directly using npx:

npx mdsf-cli format .

Homebrew

brew install hougesen/tap/mdsf

Usage

mdsf 0.3.3-dev
Format markdown code snippets using your favorite code formatters
Mads Hougesen <[email protected]>

Usage: mdsf <COMMAND>

Commands:
  format       Run formatters on input files
  verify       Verify files are formatted
  init         Create a new mdsf config
  completions  Generate shell completion
  cache-prune  Remove old caches
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Formatting code

mdsf format file.md
Run formatters on input files

Usage: mdsf format [OPTIONS] [INPUT]...

Arguments:
  [INPUT]...  Path to files and/or directories

Options:
      --config <CONFIG>        Path to config
      --debug                  Log stdout and stderr of formatters
      --log-level <LOG_LEVEL>  [possible values: trace, debug, info, warn, error, off]
      --threads <THREADS>      Amount of threads to use. Defaults to 0 (auto)
      --cache                  Only format changed codeblocks
  -h, --help                   Print help
  -V, --version                Print version

Verifying code

mdsf verify docs/
Verify files are formatted

Usage: mdsf verify [OPTIONS] [INPUT]...

Arguments:
  [INPUT]...  Path to files and/or directories

Options:
      --config <CONFIG>        Path to config
      --debug                  Log stdout and stderr of formatters
      --log-level <LOG_LEVEL>  [possible values: trace, debug, info, warn, error, off]
      --threads <THREADS>      Amount of threads to use. Defaults to 0 (auto)
  -h, --help                   Print help
  -V, --version                Print version

Configuration

The default configuration of mdsf aims to as sane as possible. For that reason the default formatter for each language is the one most people have installed.

If you are interested in customizing which formatter is run, you can create a new mdsf configuration file by running

mdsf init

mdsf supports running multiple formatters on the save code snippet.

{
  "languages": {
    // Only run `ruff` on Python snippets,
    "python": "ruff:format",
    // Run `usort` on file and then `black`
    "python": ["usort", "black"],
    // Run `usort`, if that fails run `isort`, finally run `black`
    "python": [["usort", "isort"], "black"],

    // Formatters listed under "*" will be run on any snippet.
    "*": ["typos"],

    // Formatters listed under "_" will only be run when there is not formatter configured for the file type OR globally ("*").
    "_": "prettier"
  }
}

Tools

Note

mdsf is not a package manager.

Only tools that are already installed will be used.

mdsf currently supports 211 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃

Name Description Categories Languages
alejandra The Uncompromising Nix Code Formatter formatter nix
ameba A static code analysis tool for Crystal linter crystal
asmfmt Go Assembler Formatter formatter go
astyle A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Code formatter c#, c++, c, java, objective-c
auto-optional Adds the Optional type-hint to arguments where the default value is None formatter python
autocorrect A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean) autocorrection
autoflake Removes unused imports and unused variables as reported by pyflakes linter python
autopep8 A tool that automatically formats Python code to conform to the PEP 8 style guid formatter python
beancount-black Opinionated code formatter, just like Python's black code formatter but for Beancount formatter beancount
beautysh A Bash beautifier for the masses formatter bash, shell
bibtex-tidy Cleaner and Formatter for BibTeX files formatter bibtex
bicep Bicep is a declarative language for describing and deploying Azure resources formatter bicep
biome One toolchain for your web project formatter, linter javascript, json, typescript, vue
black The uncompromising Python code formatter formatter python
blade-formatter An opinionated blade template formatter for Laravel that respects readability formatter blade, laravel, php
blue The slightly less uncompromising Python code formatter formatter python
bpfmt A formatter for Blueprint files formatter blueprint
brittany A Haskell source code formatter formatter haskell
brunette A best practice Python code formatter formatter python
bsfmt A code formatter for BrightScript and BrighterScript formatter brighterscript, brightscript
bslint A linter for BrightScript and BrighterScript linter brightscript, brightscripter
buf The best way of working with Protocol Buffers formatter protobuf
buildifier A bazel BUILD file formatter and formatter bazel
cabal-fmt An experiment of formatting .cabal files formatter cabal
cabal-prettify Prettify your Cabal package configuration files formatter cabal
cabal Cabal is a system for building and packaging Haskell libraries and programs formatter cabal
caddy Formats or prettifies a Caddyfile formatter caddy
caramel Formatter for the Caramel programming language formatter caramel
clang-format A tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code formatter c#, c++, c, java, javascript, json, objective-c, protobuf
clang-tidy clang-tidy is a clang-based C++ “linter” tool linter c++
cljfmt A tool for formatting Clojure code formatter clojure
cljstyle A tool for formatting Clojure code formatter clojure
codespell Check code for common misspellings autocorrection
crlfmt Formatter for CockroachDB's additions to the Go style guide formatter go
crystal Tools for the Crystal programming language formatter crystal
csharpier An Opinionated Code Formatter for C# formatter c#
css-beautify A css formatter formatter css
csscomb CSS coding style formatter formatter css
d2 Formatter for the d2 language formatter d2
dart Formatter and linter for Dart formatter, linter dart, flutter
dcm Code Quality Tool for Flutter Developers formatter, linter dart, flutter
deno Formatter and linter for JavaScript and TypeScript formatter, linter javascript, json, typescript
dfmt Dfmt is a formatter for D source code formatter d
dhall Format Dhall files formatter dhall
djade A Django template formatter formatter django, python
djlint Lint & Format HTML Templates formatter, linter handlebars, html, jinja, mustache, nunjucks, twig
docformatter Formats docstrings to follow PEP 257 formatter python
dockfmt Dockerfile format and parser. Like gofmt but for Dockerfiles formatter docker
docstrfmt A formatter for Sphinx flavored reStructuredText formatter Sphinx, python, reStructuredText
doctoc Generates table of contents for markdown files formatter markdown
dotenv-linter Lightning-fast linter for .env files linter env
dprint A pluggable and configurable code formatting platform written in Rust formatter
easy-coding-standard The Easiest way to add coding standard to your PHP project formatter, linter php
efmt Erlang code formatter formatter erlang
elm-format elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide formatter elm
erb-formatter Format ERB files with speed and precision formatter erb, ruby
erlfmt An automated code formatter for Erlang formatter erlang
eslint Find and fix problems in your JavaScript code linter javascript, typescript
fantomas FSharp source code formatter formatter fsharp
fish_indent Fish indenter and prettifier formatter fish
fixjson JSON Fixer for Humans using (relaxed) JSON5 formatter, linter json5, json
floskell Floskell is a flexible Haskell source code pretty printer formatter haskell
fnlfmt A formatter for Fennel code formatter fennel
forge A Solidity formatter formatter solidity
fourmolu A formatter for Haskell source code formatter haskell
fprettify Auto-formatter for modern Fortran source code formatter fortran
gci GCI, a tool that control golang package import order and make it always deterministic formatter go
gdformat GDScript linter formatter gdscript
gersemi A formatter to make your CMake code the real treasure formatter cmake
gleam Format Gleam source code formatter gleam
gluon Code formatting for the gluon programming language formatter gluon
gofmt Gofmt formats Go programs formatter go
gofumpt A stricter gofmt formatter go
goimports-reviser Right imports sorting & code formatting tool (goimports alternative) formatter go
goimports goimports updates your Go import lines, adding missing ones and removing unreferenced ones formatter go
golines A golang formatter that fixes long lines formatter go
google-java-format Reformats Java source code to comply with Google Java Style formatter java
grain Code formatter for the Grain programming language formatter grain
haml-lint Tool for writing clean and consistent HAML linter haml
hfmt Format Haskell programs. Inspired by the gofmt utility formatter haskell
hindent Extensible Haskell pretty printer formatter haskell
hlint Haskell source code suggestions linter haskell
html-beautify A html formatter formatter html
htmlbeautifier A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates formatter erb, html, ruby
imba A formatter for Imba formatter imba
isort A Python utility to sort imports formatter python
joker Small Clojure interpreter, linter and formatter formatter, linter clojure
js-beautify A JavaScript formatter formatter javascript
json5format JSON5 (a.k.a., "JSON for Humans") formatter that preserves contextual comments formatter json5, json
jsona JSONA linter and formatter formatter, linter jsona
jsonlint A JSON parser and validator with a CLI formatter, linter json
jsonnetfmt Formatter for automatically fixing jsonnet stylistic problems formatter jsonnet
juliaformatter.jl An opinionated code formatter for Julia. Plot twist - the opinion is your own formatter julia
just A formatter for justfiles formatter just
kcl KCL Format tool supports reformatting KCL files to the standard code style formatter kcl
kdlfmt A formatter for kdl documents formatter kdl
kdoc-formatter Reformats Kotlin KDoc comments, reflowing text and other cleanup formatter kotlin
ktfmt program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions formatter kotlin
ktlint An anti-bikeshedding Kotlin linter with built-in formatter linter kotlin
kulala-fmt An opinionated 🦄 .http and .rest 🐼 files linter 💄 and formatter ⚡. formatter http
leptosfmt A formatter for the leptos view! macro formatter rust
liquidsoap-prettier Prettier plugin for liquidsoap script formatter liquidsoap
luaformatter Code formatter for Lua formatter lua
markdownfmt Like gofmt, but for Markdown formatter markdown
markdownlint-cli2 A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library linter markdown
markdownlint A Node.js style checker and lint tool for Markdown/CommonMark files linter markdown
markuplint An HTML linter for all markup developers linter html
mdformat CommonMark compliant Markdown formatter formatter markdwon
mdslw Prepare your markdown for easy diff'ing! formatter markdown
misspell Correct commonly misspelled English words in source files autocorrection
mix Code formatter for Elixir formatter elixir
mojo Formats Mojo source files formatter mojo
nginxbeautifier Format and beautify nginx config files formatter nginx
nginxfmt nginx config file formatter/beautifier written in Python with no additional dependencies formatter nginx
nickel Better configuration for less formatter nickel
nimpretty Code formatter for the Nim programming language formatter nim
nixfmt The official (but not yet stable) formatter for Nix code formatter nix
nixpkgs-fmt Nix code formatter for nixpkgs formatter nix
nph An opinionated code formatter for Nim formatter nim
npm-groovy-lint Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files formatter, linter groovy
nufmt the nushell formatter formatter nushell
ocamlformat Auto-formatter for OCaml code formatter ocaml
ocp-indent Indentation tool for OCaml formatter ocaml
opa Format Rego source files formatter rego
ormolu A formatter for Haskell source code formatter haskell
oxlint Oxlint is designed to catch erroneous or useless code without requiring any configurations by default linter javascript, typescript
packer Packer is used to format HCL2 configuration files formatter hcl
perltidy Perl::Tidy, a source code formatter for Perl formatter perl
pg_format A PostgreSQL SQL syntax beautifier formatter sql
php-cs-fixer A tool to automatically fix PHP Coding Standards issues formatter, linter php
phpcbf PHP Code Beautifier and Fixer fixes violations of a defined coding standard formatter php
phpinsights Instant PHP quality checks from your console linter php
pint Laravel Pint is an opinionated PHP code style fixer for minimalists formatter, linter php
prettier Prettier is an opinionated code formatter formatter css, html, javascript, json, typescript
pretty-php The opinionated PHP code formatter formatter php
prettypst Formatter for Typst formatter typst
prisma Commands for interacting with the prisma ORM formatter prisma
protolint A pluggable linter and fixer to enforce Protocol Buffer style and conventions linter protobuf
ptop Free Pascal source formatter formatter pascal
puppet-lint Check that your Puppet manifests conform to the style guide linter puppet
purs-tidy PureScript code formatter formatter purescript
purty PureScript pretty-printer formatter purescript
pycln A formatter for finding and removing unused import statements formatter python
pyink Pyink is a Python formatter, forked from Black with a few different formatting behaviors formatter python
pyment Format and convert Python docstrings and generates patches formatter python
qmlfmt qmlfmt - command line application that formats QML files formatter qml
raco An extensible code formatter for Racket formatter racket
refmt refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason formatter reason
reformat-gherkin Reformat-gherkin automatically formats Gherkin files formatter gherkin
reorder-python-imports Rewrites source to reorder python imports formatter python
rescript Formatter for ReScript formatter rescript
roc Tools for the roc programming language formatter roc
rstfmt A formatter for reStructuredText formatter restructuredtext
rubocop A Ruby static code analyzer and formatter, based on the community Ruby style guide formatter, linter ruby
rubyfmt Ruby Autoformatter formatter ruby
ruff An extremely fast Python linter and code formatter, written in Rust formatter, linter python
rufo The Ruby Formatter formatter ruby
rune Tools for the Rune programming language formatter rune
rustfmt The official code formatter for Rust formatter rust
rustywind CLI for organizing Tailwind CSS classes formatter html
scalafmt Code formatter for Scala formatter scala
scalariform Scala source code formatter formatter scala
shellharden The corrective bash syntax highlighter linter bash, shell
shfmt Shell script formatter formatter shell
sleek Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivity formatter sql
smlfmt A custom parser/auto-formatter for Standard ML formatter standard-ml
snakefmt The uncompromising Snakemake code formatter formatter snakemake
sql-formatter A whitespace formatter for different query languages formatter sql
sqlfluff A modular SQL linter and auto-formatter with support for multiple dialects and templated code formatter, linter sql
sqlfmt sqlfmt formats your dbt SQL files so you don't have to formatter sql
sqruff Fast SQL formatter/linter formatter, linter sql
standardjs JavaScript style guide, linter, and formatter formatter, linter javascript
standardrb Ruby's bikeshed-proof linter and formatter formatter, linter ruby
stylefmt stylefmt is a tool that automatically formats stylesheets formatter css, scss
stylelint A mighty CSS linter that helps you avoid errors and enforce conventions linter css, scss
stylish-haskell Haskell code prettifier formatter haskell
stylua An opinionated Lua code formatter formatter lua
superhtml HTML Language Server & Templating Language Library formatter html
swift-format Formatting technology for Swift source code formatter swift
swiftformat A command-line tool and Xcode Extension for formatting Swift code formatter swift
taplo A TOML toolkit written in Rust formatter toml
templ Tooling for the Templ template language formatter go, templ
terraform The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style formatter terraform
terragrunt Recursively find hcl files and rewrite them into a canonical format formatter hcl
tlint Tighten linter for Laravel conventions linter php
tofu The tofu fmt command is used to rewrite OpenTofu configuration files to a canonical format and style formatter terraform, tofu
topiary Topiary aims to be a uniform formatter for simple languages, as part of the Tree-sitter ecosystem formatter
ts-standard Typescript style guide, linter, and formatter using StandardJS formatter, linter typescript
tsqllint Configurable linting for TSQL linter sql
twig-cs-fixer A tool to automatically fix Twig Coding Standards issues formatter, linter twig
typos Source code spell checker autocorrection
typstfmt Basic formatter for the Typst language formatter typst
typstyle Beautiful and reliable typst code formatter formatter typst
ufmt Safe, atomic formatting with black and usort formatter python
uiua A stack-based array programming language formatter uiua
unimport The ultimate linter and formatter for removing unused import statements in your code formatter python
usort Safe, minimal import sorting for Python projects formatter python
v Tooling for V lang formatter v
veryl Veryl: A Modern Hardware Description Language formatter veryl
vhdl-style-guide Style guide enforcement for VHDL formatter vhdl
wfindent Indents and optionally converts Fortran program sources formatter fortran
xmlformat Format and compress XML documents formatter xml
xmllint XML linter linter xml
xo JavaScript/TypeScript linter (ESLint wrapper) with great defaults linter javascript, typescript
yamlfix A simple opinionated yaml formatter that keeps your comments formatter yaml
yamlfmt An extensible command line tool or library to format yaml files formatter yaml
yapf A formatter for Python files formatter python
yew-fmt Code formatter for the Yew framework formatter rust
zig Reformat Zig source into canonical form formatter zig
ziggy Formats Ziggy documents and Ziggy schemas formatter ziggy
zprint Executables, uberjar, and library to beautifully format Clojure and Clojurescript source code and s-expressions formatter clojure, clojurescript

Commands

mdsf currently supports 216 commands. Feel free to open an issue/pull-request if your favorite tool is missing! 😃

Name Command
alejandra alejandra --quiet $PATH
ameba ameba --fix $PATH
asmfmt asmfmt -w $PATH
astyle astyle --quiet $PATH
auto-optional auto-optional $PATH
autocorrect autocorrect --fix $PATH
autoflake autoflake --quiet --in-place $PATH
autopep8 autopep8 --in-place $PATH
beancount-black bean-black $PATH
beautysh beautysh $PATH
bibtex-tidy bibtex-tidy -m $PATH
bicep:format bicep format $PATH
biome:check biome check --write $PATH
biome:format biome format --write $PATH
biome:lint biome lint --write $PATH
black black --quiet $PATH
blade-formatter blade-formatter --write $PATH
blue blue --quiet $PATH
bpfmt bpfmt -w $PATH
brittany brittany --write-mode=inplace $PATH
brunette brunette --quiet $PATH
bsfmt bsfmt $PATH --write
bslint bslint --fix $PATH
buf:format buf format --write $PATH
buildifier buildifier $PATH
cabal-fmt cabal-fmt --inplace $PATH
cabal-prettify cabal-prettify $PATH
cabal:format cabal format $PATH
caddy:fmt caddy fmt $PATH -w
caramel:fmt caramel fmt $PATH
clang-format clang-format -i $PATH
clang-tidy clang-tidy --fix $PATH
cljfmt:fix cljfmt fix $PATH
cljstyle cljstyle fix $PATH
codespell codespell $PATH --check-hidden --write-changes
crlfmt crlfmt -w $PATH
crystal:format crystal tool format $PATH
csharpier dotnet csharpier $PATH
css-beautify css-beautify -r --type css -f $PATH
csscomb csscomb -t $PATH
d2:fmt d2 fmt $PATH
dart:fix dart fix --apply $PATH
dart:format dart format $PATH
dcm:fix dcm fix $PATH
dcm:format dcm format $PATH
deno:fmt deno fmt --quiet $PATH
deno:lint deno lint --fix $PATH
dfmt dfmt -i $PATH
dhall dhall format $PATH
djade djade $PATH
djlint djlint $PATH --reformat
docformatter docformatter --in-place $PATH
dockfmt dockfmt fmt -w $PATH
docstrfmt docstrfmt $PATH
doctoc doctoc $PATH
dotenv-linter:fix dotenv-linter fix $PATH
dprint:fmt dprint fmt $PATH
easy-coding-standard ecs check $PATH --fix --no-interaction
efmt efmt -w $PATH
elm-format elm-format --elm-version=0.19 --yes $PATH
erb-formatter erb-format $PATH --write
erlfmt erlfmt -w $PATH_STRING
eslint eslint --fix $PATH
fantomas fantomas $PATH
fish_indent fish_indent -w $PATH
fixjson fixjson -w $PATH
floskell floskell $PATH
fnlfmt fnlfmt $PATH
forge:fmt forge fmt $PATH
fourmolu fourmolu -i $PATH
fprettify fprettify $PATH
gci gci write --skip-generated --skip-vender $PATH
gdformat gdformat $PATH
gersemi gersemi -i -q $PATH
gleam:format gleam format $PATH
gluon:fmt gluon fmt $PATH
gofmt gofmt -w $PATH
gofumpt gofumpt -w $PATH
goimports-reviser goimports-reviser -format $PATH
goimports goimports -w $PATH
golines golines -w $PATH
google-java-format google-java-format -i $PATH
grain:format grain format $PATH -o $PATH
haml-lint haml-lint --auto-correct $PATH
hfmt hfmt -w $PATH
hindent hindent $PATH
hlint hlint --refactor -i $PATH
html-beautify html-beautify -r --type html -f $PATH
htmlbeautifier htmlbeautifier $PATH
imba:fmt imba fmt -f $PATH
isort isort --quiet $PATH
joker joker --format --write $PATH
js-beautify js-beautify -r --type js -f $PATH
json5format json5format -r $PATH
jsona:format jsona format $PATH
jsona:lint jsona lint $PATH
jsonlint jsonlint -i $PATH
jsonnetfmt jsonnetfmt -i $PATH
juliaformatter.jl julia -E using JuliaFormatter;format_file(\"{$PATH_STRING}\")
just just --fmt --unstable --justfile $PATH
kcl:fmt kcl fmt $PATH
kdlfmt kdlfmt format $PATH
kdoc-formatter kdoc-formatter --quiet $PATH
ktfmt ktfmt --format --log-level=error $PATH
ktlint ktlint --format --log-level=error $PATH
kulala-fmt kulala-fmt $PATH
leptosfmt leptosfmt --quiet $PATH
liquidsoap-prettier liquidsoap-prettier --write $PATH
luaformatter lua-format -i $PATH
markdownfmt markdownfmt -w $PATH
markdownlint-cli2 markdownlint-cli2 --fix $PATH
markdownlint markdownlint --fix $PATH
markuplint markuplint --fix $PATH
mdformat mdformat $PATH
mdslw mdslw $PATH
misspell misspell -w $PATH
mix:format mix format $PATH
mojo:format mojo format -q $PATH
nginxbeautifier nginxbeautifier $PATH
nickel:format nickel format $PATH
nimpretty nimpretty $PATH
nixfmt nixfmt $PATH
nixpkgs-fmt nixpkgs-fmt $PATH
nph nph $PATH
npm-groovy-lint npm-groovy-lint --format $PATH
ocamlformat ocamlformat --ignore-invalid-option --inplace --enable-outside-detected-project $PATH
ocp-indent ocp-indent --inplace $PATH
opa:fmt opa fmt $PATH -w
ormolu ormolu --mode inplace $PATH
oxlint oxlint --fix $PATH
packer:fmt packer fmt $PATH
perltidy perltidy -b $PATH
pg_format pg_format --inplace $PATH
php-cs-fixer:fix php-cs-fixer fix $PATH
phpcbf phpcbf $PATH
phpinsights:fix phpinsights fix $PATH --no-interaction --quiet
pint pint $PATH
prettier prettier --embedded-language-formatting off --log-level error --write $PATH
pretty-php pretty-php $PATH
prettypst prettypst $PATH
protolint protolint lint -fix $PATH
ptop ptop $PATH $PATH
puppet-lint puppet-lint --fix $PATH
purs-tidy purs-tidy format-in-place $PATH
purty purty --write $PATH
pycln pycln --no-gitignore --quiet $PATH
pyink pyink --quiet $PATH
pyment pyment -w $PATH
qmlfmt qmlfmt -w $PATH
raco:fmt raco fmt -i $PATH
refmt refmt --in-place $PATH
reformat-gherkin reformat-gherkin $PATH
reorder-python-imports reorder-python-imports $PATH
rescript:format rescript format $PATH
roc:format roc format $PATH
rstfmt rstfmt $PATH
rubocop rubocop --fix-layout --autocorrect --format quiet $PATH
rubyfmt rubyfmt -i $PATH
ruff:check ruff check --fix --quiet $PATH
ruff:format ruff format --quiet $PATH
rufo rufo --simple-exit $PATH
rune:fmt rune fmt $PATH
rustfmt rustfmt --edition 2021 --quiet $PATH
rustywind rustywind --write $PATH
scalafmt scalafmt --quiet --mode any $PATH
scalariform scalariform $PATH
shellharden shellharden --transform --replace $PATH
shfmt shfmt --write $PATH
sleek sleek $PATH
smlfmt smlfmt --force $PATH
snakefmt snakefmt $PATH
sql-formatter sql-formatter --fix $PATH
sqlfluff:fix sqlfluff fix --dialect ansi $PATH
sqlfluff:format sqlfluff format --dialect ansi $PATH
sqlfmt sqlfmt $PATH
sqruff sqruff fix $PATH
standardjs standard --fix $PATH
standardrb standardrb --fix $PATH
stylefmt stylefmt $PATH
stylelint stylelint --fix $PATH
stylish-haskell stylish-haskell --inplace $PATH
stylua stylua --verify $PATH
superhtml:fmt superhtml fmt $PATH
swift-format swift-format --in-place $PATH
swiftformat swiftformat --quiet $PATH
taplo taplo format $PATH
templ:fmt templ fmt $PATH
terraform:fmt terraform fmt -write=true $PATH
terragrunt:hclfmt terragrunt hclfmt --terragrunt-hclfmt-file $PATH
tlint:format tlint format $PATH
tofu:fmt tofu fmt -write=true $PATH
topiary topiary format $PATH
ts-standard ts-standard --fix $PATH
tsqllint tsqllint --fix $PATH
twig-cs-fixer:lint twig-cs-fixer lint $PATH --fix --no-interaction --quiet
typos typos -w --no-ignore --hidden $PATH
typstfmt typstfmt $PATH
typstyle typstyle -i $PATH
ufmt ufmt format $PATH
uiua:fmt uiua fmt $PATH
unimport unimport -r $PATH
usort usort format $PATH
v:fmt v fmt -w $PATH
veryl:fmt veryl fmt $PATH
vhdl-style-guide vsg -f $PATH --fix
wfindent wfindent $PATH
xmlformat xmlformat --overwrite $PATH
xmllint xmllint --format $PATH --output $PATH
xo xo --fix $PATH
yamlfix yamlfix $PATH
yamlfmt yamlfmt -quiet $PATH
yapf yapf --in-place $PATH
yew-fmt yew-fmt --edition 2021 --quiet $PATH
zig:fmt zig fmt $PATH
ziggy:fmt ziggy fmt $PATH
zprint zprint -w $PATH

Shell completions

Shell completions can be generated using mdsf completions <SHELL>.

Generate shell completion

Usage: mdsf completions <SHELL>

Arguments:
  <SHELL>  [possible values: bash, elvish, fish, powershell, zsh]

Options:
  -h, --help     Print help
  -V, --version  Print version

Bash

Add the following to your .bashrc.

eval "$(mdsf completions bash)"

Bash

Add the following to your .zshrc.

eval "$(mdsf completions zsh)"

Fish

Add the following to ~/.config/fish/config.fish.

mdsf completions fish | source

PowerShell

Add the following to your PowerShell configuration (Can be found by running $PROFILE).

Invoke-Expression (&mdsf completions powershell)

Elvish

Add the following to ~/.elvish/rc.elv.

eval (mdsf completions elvish)

Acknowledgement

mdsf was inspired by the amazing neovim formatting plugin conform.nvim.

Alternatives to mdsf