mdsf
Format, and lint, markdown code snippets using your favorite tools.
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
Conda
An unofficial (and unsupported) Conda package can be found at https://anaconda.org/conda-forge/mdsf.
conda install conda-forge::mdsf
Usage
mdsf 0.9.7-next
Format, and lint, markdown code snippets using your favorite tools
Mads Hougesen <[email protected]>
Usage: mdsf [OPTIONS] <COMMAND>
Commands:
format Run tools on input files
verify Verify files are formatted
init Create a new mdsf config
completions Generate shell completion
cache-prune Remove caches
help Print this message or the help of the given subcommand(s)
Options:
--log-level <LOG_LEVEL> [possible values: trace, debug, info, warn, error, off]
-h, --help Print help
-V, --version Print version
Formatting code
The format
command, as the name implies, is used to format documents.
mdsf format file.md
Run tools on input files
Usage: mdsf format [OPTIONS] [INPUT]...
Arguments:
[INPUT]...
Path to files and/or directories
Options:
--stdin
Read input from stdin and write output to stdout
--config <CONFIG>
Path to config file
--debug
Log stdout and stderr of formatters
--threads <THREADS>
Amount of threads to use.
Defaults to 0 (auto).
--cache
Cache results
--log-level <LOG_LEVEL>
[possible values: trace, debug, info, warn, error, off]
--timeout <TIMEOUT>
Tool timeout in seconds.
Defaults to no timeout.
--on-missing-language-definition <ON_MISSING_LANGUAGE_DEFINITION>
What to do when a codeblock language has no tools defined
[possible values: ignore, fail, fail-fast]
--on-missing-tool-binary <ON_MISSING_TOOL_BINARY>
What to do when the binary of a tool cannot be found
[possible values: ignore, fail, fail-fast]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Caching formatting results
To speed formatting caching can be enabled by supplying the format
command with the --cache
argument.
mdsf format --cache docs/
Removing old caches
Old caches can be removed by running the mdsf cache-prune
command.
Remove caches
Usage: mdsf cache-prune [OPTIONS]
Options:
--log-level <LOG_LEVEL> [possible values: trace, debug, info, warn, error, off]
-h, --help Print help
-V, --version Print version
Verifying code
You can verify that the document is formatted using the mdsf verify
command.
mdsf verify docs/
Verify files are formatted
Usage: mdsf verify [OPTIONS] [INPUT]...
Arguments:
[INPUT]...
Path to files and/or directories
Options:
--stdin
Read input from stdin and write output to stdout
--config <CONFIG>
Path to config file
--debug
Log stdout and stderr of formatters
--threads <THREADS>
Amount of threads to use.
Defaults to 0 (auto).
--timeout <TIMEOUT>
Tool timeout in seconds.
Defaults to no timeout.
--log-level <LOG_LEVEL>
[possible values: trace, debug, info, warn, error, off]
--on-missing-language-definition <ON_MISSING_LANGUAGE_DEFINITION>
What to do when a codeblock language has no tools defined
[possible values: ignore, fail, fail-fast]
--on-missing-tool-binary <ON_MISSING_TOOL_BINARY>
What to do when the binary of a tool cannot be found
[possible values: ignore, fail, fail-fast]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
GitHub Action
There are a lot of different ways to run mdsf
using GitHub actions.
The easiest way, in my opinion, is to use the official GitHub action to install mdsf.
After that you can run the binary like you would in your terminal.
[!NOTE] mdsf is not a package manager.
You must also install the tools you wish to use in your GitHub action.
name: mdsf
on: push
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install mdsf
uses: hougesen/mdsf@main
- name: Run mdsf
run: mdsf format --log-level warn .
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: "style: formatted markdown code blocks"
Visual Studio Code
mdsf can be run using the VSCode extension.
[!NOTE] The mdsf VS Code extension does currently not support installing mdsf. Which means mdsf must be installed using other means.
Vim / NeoVim
conform.nvim
conform.nvim has native support for running mdsf.
local conform = require("conform")
conform.setup({
formatters_by_ft = {
markdown = { "mdsf" },
-- ...
},
-- ...
})
treefmt
Add the following to your treefmt.toml
to run mdsf using treefmt.
# treefmt.toml
[formatter.mdsf]
command = "mdsf"
options = ["format"]
includes = ["*.md"]
Configuration
The default configuration of mdsf
aims to as simple 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
.
Create a new mdsf config
Usage: mdsf init [OPTIONS]
Options:
--force Create config even if one already exists in current directory
--log-level <LOG_LEVEL> [possible values: trace, debug, info, warn, error, off]
-h, --help Print help
-V, --version Print version
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"
}
}
Language aliases
Multiple languages can easily be mapped to the same tools using the language_aliases
option.
{
"language_aliases": {
"language": "is_alias_of"
}
}
In the example below bash
and zsh
would use the tools defined under languages.shell
.
{
"languages": {
"shell": "shfmt"
},
"language_aliases": {
"bash": "shell",
"zsh": "shell"
}
}
Newlines
By default LF () is used for newlines.
That can be changed by specifying the newline
config option.
{
"newline": "lf" // "lf" | "cr" | "crlf"
}
Tools
[!NOTE] mdsf is not a package manager.
Only tools that are already installed will be used.
mdsf
currently supports 317 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃
ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you
linter
ansible
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
Adds the Optional type-hint to arguments where the default value is None
formatter
python
A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean)
spell-check
A tool that automatically formats Python code to conform to the PEP 8 style guid
formatter
python
Opinionated code formatter, just like Python's black code formatter but for Beancount
formatter
beancount
An opinionated blade template formatter for Laravel that respects readability
formatter
blade
, laravel
, php
A tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code
formatter
c#
, c++
, c
, java
, javascript
, json
, objective-c
, protobuf
cmake-format can format your listfiles nicely so that they don't look like crap
formatter
cmake
CUE tool that updates your import lines, adding missing ones and removing unused ones
formatter
cue
Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid
linter
django
, html
, jinja
, liquid
, nunjucks
, twig
Lint & Format HTML Templates
formatter
, linter
handlebars
, html
, jinja
, mustache
, nunjucks
, twig
Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards
formatter
, linter
php
elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
formatter
elm
A simple fortran syntax checker, including automatic fixing of the code
formatter
, linter
fortran
Parallelized formatter with no external dependencies for gherkin (cucumber, behat)
formatter
behat
, cucumber
, gherkin
goimports updates your Go import lines, adding missing ones and removing unreferenced ones
formatter
go
A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates
formatter
erb
, html
, ruby
JSON5 (a.k.a., JSON for Humans) formatter that preserves contextual comments
formatter
json5
, json
An opinionated code formatter for Julia. Plot twist - the opinion is your own
formatter
julia
keep-sorted is a language-agnostic formatter that sorts lines between two markers in a larger file
formatter
program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions
formatter
kotlin
A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library
linter
markdown
Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible
formatter
meson
nginx config file formatter/beautifier written in Python with no additional dependencies
formatter
nginx
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files
formatter
, linter
groovy
Oxlint is designed to catch erroneous or useless code without requiring any configurations by default
linter
javascript
, typescript
Prettier is an opinionated code formatter
formatter
angular
, css
, ember
, graphql
, handlebars
, html
, javascript
, json
, less
, markdown
, scss
, typescript
, vue
A pluggable linter and fixer to enforce Protocol Buffer style and conventions
linter
protobuf
A Python docstring linter that checks arguments, returns, yields, and raises sections
linter
python
Automatically format your Python docstrings to conform with PEP 8 and PEP 257
formatter
python
Pyink is a Python formatter, forked from Black with a few different formatting behaviors
formatter
python
refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason
formatter
reason
Regal is a linter and language server for Rego, bringing your policy development experience to the next level
linter
rego
~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
linter
go
A Ruby static code analyzer and formatter, based on the community Ruby style guide
formatter
, linter
ruby
All the goodness of standardjs with semicolons sprinkled on top
formatter
, linter
javascript
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
Solhint is an open-source project to provide a linting utility for Solidity code
linter
solidity
Check for stylistic and formal issues in .rst and .py files included in the documentation
linter
python
, restructredtext
A modular SQL linter and auto-formatter with support for multiple dialects and templated code
formatter
, linter
sql
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style
formatter
terraform
The tofu fmt command is used to rewrite OpenTofu configuration files to a canonical format and style
formatter
terraform
, tofu
Topiary aims to be a uniform formatter for simple languages, as part of the Tree-sitter ecosystem
formatter
Typescript style guide, linter, and formatter using StandardJS
formatter
, linter
typescript
The ultimate linter and formatter for removing unused import statements in your code
formatter
python
vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool
linter
json
, openapi
, yaml
Executables beautifully format Clojure and Clojurescript source code and s-expressions
formatter
clojure
, clojurescript
Commands
mdsf
currently supports 353 commands. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃
actionlint
actionlint $PATH
air:format
air format $PATH
alejandra
alejandra --quiet $PATH
alex
alex --quiet $PATH
ameba
ameba --fix $PATH
ansible-lint
ansible-lint $PATH
asmfmt
asmfmt -w $PATH
astyle
astyle --quiet $PATH
atlas:fmt
atlas schema fmt $PATH
auto-optional
auto-optional $PATH
autocorrect
autocorrect --fix $PATH
autoflake
autoflake --quiet --in-place $PATH
autopep8
autopep8 --in-place $PATH
bashate
bashate $PATH
beancount-black
bean-black $PATH
beautysh
beautysh $PATH
bibtex-tidy
bibtex-tidy -m $PATH
bicep:format
bicep format $PATH
biome:check:unsafe
biome check --write --unsafe $PATH
biome:check
biome check --write $PATH
biome:format
biome format --write $PATH
biome:lint:unsafe
biome lint --write --unsafe $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
buf:lint
buf lint $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
cedar:format
cedar format
cfn-lint
cfn-lint $PATH
checkmake
checkmake $PATH
clang-format
clang-format -i $PATH
clang-tidy
clang-tidy --fix $PATH
clj-kondo
clj-kondo --lint $PATH
cljfmt:fix
cljfmt fix $PATH
cljstyle
cljstyle fix $PATH
cmake-format
cmake-format -i $PATH
cmake-lint
cmake-lint $PATH
codeql:query:format
codeql query format -i $PATH
codespell
codespell $PATH --check-hidden --write-changes
coffeelint
coffeelint -q $PATH
cppcheck
cppcheck $PATH
cpplint
cpplint --quiet $PATH
crlfmt
crlfmt -w $PATH
crystal:format
crystal tool format $PATH
csharpier
csharpier format --write-stdout
css-beautify
css-beautify -r --type css -f $PATH
csscomb
csscomb -t $PATH
csslint
csslint --quiet $PATH
cue:fmt
cue fmt $PATH
cueimports
cueimports
curlylint
curlylint -q $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
deadnix
deadnix -q --edit $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
dockerfmt
dockerfmt -w -n $PATH
dockfmt
dockfmt fmt -w $PATH
docstrfmt
docstrfmt $PATH
doctoc
doctoc $PATH
dotenv-linter:fix
dotenv-linter fix $PATH
dprint:fmt
dprint fmt $PATH
dscanner:fix
dscanner fix $PATH
dscanner:lint
dscanner lint $PATH
duster:fix
duster fix --quiet --no-interaction $PATH
duster:lint
duster lint --quiet --no-interaction $PATH
dx:fmt
dx fmt --all-code --file $PATH
easy-coding-standard
ecs check $PATH --fix --no-interaction
efmt
efmt -w $PATH
elm-format
elm-format --elm-version=0.19 --yes $PATH
eradicate
eradicate --in-place $PATH
erb-formatter
erb-format $PATH --write
erg:lint
erg lint $PATH
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
flynt
flynt $PATH
fnlfmt
fnlfmt $PATH
forge:fmt
forge fmt $PATH
fortitude:check:fix:unsafe
fortitude check --quiet --no-respect-gitignore --fix --unsafe-fixes $PATH
fortitude:check:fix
fortitude check --quiet --no-respect-gitignore --fix $PATH
fortitude:check
fortitude check --quiet --no-respect-gitignore $PATH
fortran-linter
fortran-linter -i $PATH
fourmolu
fourmolu -i $PATH
fprettify
fprettify $PATH
futhark:fmt
futhark fmt $PATH
fvm:dart:fix
fvm dart fix --apply $PATH
fvm:dart:format
fvm dart format $PATH
gci
gci write --skip-generated --skip-vendor $PATH
gdformat
gdformat $PATH
gdlint
gdlint $PATH
gersemi
gersemi -i -q $PATH
ghokin:fmt
ghokin fmt replace $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
golangci-lint:fmt
golangci-lint fmt $PATH
golangci-lint:run:fix
golangci-lint run --fix $PATH
golangci-lint:run
golangci-lint run $PATH
golines
golines -w $PATH
google-java-format
google-java-format -i $PATH
gospel
gospel $PATH
grafbase:lint
grafbase lint $PATH
grain:format
grain format $PATH -o $PATH
hadolint
hadolint $PATH
haml-lint
haml-lint --auto-correct $PATH
hclfmt
hclfmt -w $PATH
hfmt
hfmt -w $PATH
hindent
hindent $PATH
hlint
hlint $PATH
html-beautify
html-beautify -r --type html -f $PATH
htmlbeautifier
htmlbeautifier $PATH
htmlhint
htmlhint $PATH
hurlfmt
hurlfmt --in-place $PATH
imba:fmt
imba fmt -f $PATH
inko:fmt
inko fmt $PATH
isort
isort --quiet $PATH
janet-format
janet-format
joker
joker --format --write $PATH
jq
jq
jqfmt
jqfmt
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
jsonnet-lint
jsonnet-lint $PATH
jsonnetfmt
jsonnetfmt -i $PATH
jsonpp
jsonpp -s
juliaformatter.jl
julia -E using JuliaFormatter;format_file(\"{$PATH_STRING}\")
just
just --fmt --unstable --justfile $PATH
kcl:fmt
kcl fmt $PATH
kcl:lint
kcl lint $PATH
kdlfmt:v1
kdlfmt format --kdl-version v1 $PATH
kdlfmt:v2
kdlfmt format --kdl-version v2 $PATH
kdlfmt
kdlfmt format $PATH
kdoc-formatter
kdoc-formatter --quiet $PATH
keep-sorted
keep-sorted $PATH
ktfmt
ktfmt $PATH
ktlint
ktlint --format --log-level=error $PATH
kulala-fmt:check
kulala-fmt check $PATH
kulala-fmt:format
kulala-fmt format $PATH
leptosfmt
leptosfmt $PATH
liquidsoap-prettier
liquidsoap-prettier --write $PATH
luacheck
luacheck $PATH
luaformatter
lua-format -i $PATH
luau-analyze
luau-analyze $PATH
mado:check
mado check $PATH
mago:format
mago format $PATH
mago:lint:fix:unsafe
mago lint --fix --potentially-unsafe --unsafe $PATH
mago:lint:fix
mago lint --fix $PATH
mago:lint
mago lint $PATH
markdownfmt
markdownfmt -w $PATH
markdownlint-cli2
markdownlint-cli2 --fix $PATH
markdownlint
markdownlint --fix $PATH
markuplint
markuplint --fix $PATH
md-padding
md-padding -i $PATH
mdformat
mdformat $PATH
mdsf:format
mdsf format $PATH
mdsf:verify
mdsf verify $PATH
mdslw
mdslw $PATH
meson:fmt
meson fmt -i $PATH
mise:fmt
mise fmt --stdin
misspell
misspell -w $PATH
mix:format
mix format $PATH
mojo:format
mojo format -q $PATH
muon:fmt
muon fmt -i $PATH
muon:lint
muon lint -i $PATH
mypy
mypy $PATH
nasmfmt
nasmfmt $PATH
nginxbeautifier
nginxbeautifier $PATH
nginxfmt
nginxfmt $PATH
nickel:format
nickel format $PATH
nimpretty
nimpretty $PATH
nixfmt
nixfmt $PATH
nixpkgs-fmt
nixpkgs-fmt $PATH
nomad:fmt
nomad fmt $PATH
nph
nph $PATH
npm-groovy-lint
npm-groovy-lint --format $PATH
nufmt
nufmt $PATH
ocamlformat
ocamlformat --ignore-invalid-option --inplace --enable-outside-detected-project $PATH
ocp-indent
ocp-indent --inplace $PATH
odinfmt
odinfmt -w $PATH
oelint-adv
oelint-adv --fix --nobackup --quiet $PATH
opa:fmt
opa fmt $PATH -w
ormolu
ormolu --mode inplace $PATH
oxlint
oxlint --fix $PATH
packer:fix
packer fix $PATH
packer:fmt
packer fmt $PATH
packer:validate
packer validate $PATH
pasfmt
pasfmt $PATH
perflint
perflint $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
prisma:format
prisma format --schema={$PATH_STRING}
proselint
proselint $PATH
protolint
protolint lint -fix $PATH
ptop
ptop $PATH $PATH
pug-lint
pug-lint $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
pycodestyle
pycodestyle $PATH
pydoclint
pydoclint $PATH
pydocstringformatter
pydocstringformatter -w $PATH
pydocstyle
pydocstyle $PATH
pyflakes
pyflakes $PATH
pyink
pyink --quiet $PATH
pylint
pylint --module-naming-style=any $PATH
pyment
pyment -w $PATH
pyrefly
pyrefly check $PATH
pyupgrade
pyupgrade $PATH
qmlfmt
qmlfmt -w $PATH
quick-lint-js
quick-lint-js $PATH
raco:fmt
raco fmt -i $PATH
reek
reek $PATH
refmt
refmt --in-place $PATH
reformat-gherkin
reformat-gherkin $PATH
refurb
refurb $PATH
regal:fix
regal fix $PATH
regal:lint
regal lint $PATH
reorder-python-imports
reorder-python-imports $PATH
rescript:format
rescript format $PATH
revive
revive $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
runic
runic --inplace $PATH
rustfmt
rustfmt --edition 2021 --quiet $PATH
rustywind
rustywind --write $PATH
salt-lint
salt-lint $PATH
scalafmt
scalafmt --quiet --mode any $PATH
scalariform
scalariform $PATH
selene
selene --no-summary --quiet $PATH
semistandard
semistandard --fix --stdin
shellcheck
shellcheck $PATH
shellharden
shellharden --transform --replace $PATH
shfmt
shfmt --write $PATH
sleek
sleek $PATH
slim-lint
slim-lint $PATH
smlfmt
smlfmt --force $PATH
snakefmt
snakefmt $PATH
solhint
solhint --quiet --fix --noPrompt $PATH
sphinx-lint
sphinx-lint $PATH
sql-formatter
sql-formatter --fix $PATH
sqlfluff:fix
sqlfluff fix --disable-progress-bar --nocolor --dialect ansi $PATH
sqlfluff:format
sqlfluff format --disable-progress-bar --nocolor --dialect ansi $PATH
sqlfluff:lint
sqlfluff lint --disable-progress-bar --nocolor --dialect ansi $PATH
sqlfmt
sqlfmt $PATH
sqruff
sqruff fix --force $PATH
squawk
squawk $PATH
standardjs
standard --fix --stdin
standardrb
standardrb --fix $PATH
statix:check
statix check $PATH
statix:fix
statix fix $PATH
stylefmt
stylefmt $PATH
stylelint
stylelint --fix $PATH
stylish-haskell
stylish-haskell --inplace $PATH
stylua
stylua --verify $PATH
superhtml:fmt
superhtml fmt $PATH
svlint
svlint $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
tex-fmt
tex-fmt $PATH
textlint:fix
textlint --fix $PATH
textlint
textlint $PATH
tlint:format
tlint format $PATH
tofu:fmt
tofu fmt -write=true $PATH
tombi:format
tombi format $PATH
tombi:lint
tombi lint $PATH
toml-sort
toml-sort -i $PATH
topiary
topiary format $PATH
tryceratops
tryceratops --autofix $PATH
ts-standard
ts-standard --fix $PATH
tsp:format
tsp format $PATH
tsqllint
tsqllint --fix $PATH
twig-cs-fixer:lint
twig-cs-fixer lint $PATH --fix --no-interaction --quiet
twigcs
twigcs $PATH
ty
ty check $PATH
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
vacuum:lint
vacuum lint $PATH
verusfmt
verusfmt $PATH
veryl:fmt
veryl fmt $PATH
vhdl-style-guide
vsg -f $PATH --fix
vint:neovim
vint --enable-neovim $PATH
vint
vint $PATH
wa:fmt
wa fmt $PATH
wfindent
wfindent $PATH
write-good
write-good $PATH
xmlformat
xmlformat --overwrite $PATH
xmllint
xmllint --format $PATH --output $PATH
xo
xo --fix --stdin
xq:html
xq --html
xq
xq
yamlfix
yamlfix $PATH
yamlfmt
yamlfmt -quiet $PATH
yamllint
yamllint $PATH
yapf
yapf --in-place $PATH
yew-fmt
yew-fmt --edition 2021 $PATH
yq
yq --inplace $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 [OPTIONS] <SHELL>
Arguments:
<SHELL> [possible values: bash, elvish, fish, nushell, powershell, zsh]
Options:
--log-level <LOG_LEVEL> [possible values: trace, debug, info, warn, error, off]
-h, --help Print help
-V, --version Print version
Bash
Add the following to your .bashrc
.
eval "$(mdsf completions bash)"
Zsh
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)
Nushell
Generate completions for nushell.
mdsf completions nushell
Acknowledgement
mdsf was inspired by the amazing neovim formatting plugin conform.nvim.
Alternatives to mdsf
conform.nvim using
injected
mode.
Last updated