mdsf
GitHub
  • mdsf
  • Changelog
  • Contributor Covenant Code of Conduct
  • Contributing to mdsf
  • mdsf Visual Studio Code Extension
Powered by GitBook
On this page
  • Table of contents
  • Installation
  • Linux & MacOS
  • Windows
  • Cargo
  • npm/npx
  • Homebrew
  • Conda
  • Usage
  • Formatting code
  • Verifying code
  • GitHub Action
  • Visual Studio Code
  • Vim / NeoVim
  • treefmt
  • Configuration
  • Language aliases
  • Newlines
  • Tools
  • Commands
  • Shell completions
  • Bash
  • Zsh
  • Fish
  • PowerShell
  • Elvish
  • Nushell
  • Acknowledgement
  • Alternatives to mdsf

mdsf

NextChangelog

Last updated 6 hours ago

Format, and lint, markdown code snippets using your favorite tools.

Table of contents

Installation

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

cargo install mdsf --locked

or directly from source:

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

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

npm/npx

npm install -g mdsf-cli

mdsf format .

or run it directly using npx:

npx mdsf-cli format .

Homebrew

brew install hougesen/tap/mdsf

Conda

conda install conda-forge::mdsf

Usage

mdsf 0.9.4-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

local conform = require("conform")

conform.setup({
	formatters_by_ft = {
		markdown = { "mdsf" },
		-- ...
	},
	-- ...
})

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 311 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃

Name
Description
Categories
Languages

Static checker for GitHub Actions workflow files

linter

yaml

R formatter and language server

formatter

r

The Uncompromising Nix Code Formatter

formatter

nix

Catch insensitive, inconsiderate writing

spell-check

markdown

A static code analysis tool for Crystal

linter

crystal

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

Go Assembler Formatter

formatter

go

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

Manage your database schema as code

formatter

hcl

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

Removes unused imports and unused variables as reported by pyflakes

linter

python

A tool that automatically formats Python code to conform to the PEP 8 style guid

formatter

python

Code style enforcement for bash programs

formatter

bash

Opinionated code formatter, just like Python's black code formatter but for Beancount

formatter

beancount

A Bash beautifier for the masses

formatter

bash, shell

Cleaner and Formatter for BibTeX files

formatter

bibtex

Bicep is a declarative language for describing and deploying Azure resources

formatter

bicep

One toolchain for your web project

formatter, linter

javascript, json, typescript, vue

The uncompromising Python code formatter

formatter

python

An opinionated blade template formatter for Laravel that respects readability

formatter

blade, laravel, php

The slightly less uncompromising Python code formatter

formatter

python

A formatter for Blueprint files

formatter

blueprint

A Haskell source code formatter

formatter

haskell

A best practice Python code formatter

formatter

python

A code formatter for BrightScript and BrighterScript

formatter

brighterscript, brightscript

A linter for BrightScript and BrighterScript

linter

brightscript, brightscripter

The best way of working with Protocol Buffers

formatter

protobuf

A bazel BUILD file formatter and

formatter

bazel

An experiment of formatting .cabal files

formatter

cabal

Prettify your Cabal package configuration files

formatter

cabal

Cabal is a system for building and packaging Haskell libraries and programs

formatter

cabal

Formats or prettifies a Caddyfile

formatter

caddy

Formatter for the Caramel programming language

formatter

caramel

CloudFormation Linter

linter

cloudformation, json, yaml

Experimental linter/analyzer for Makefiles

linter

makefile

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 is a clang-based C++ “linter” tool

linter

c++

Static analyzer and linter for Clojure code that sparks joy

linter

clojure, clojurescript

A tool for formatting Clojure code

formatter

clojure

A tool for formatting Clojure code

formatter

clojure

cmake-format can format your listfiles nicely so that they don't look like crap

formatter

cmake

Lint CMake files

linter

cmake

Format queries and libraries with CodeQL

formatter

codeql

Check code for common misspellings

spell-check

Lint your CoffeeScript

linter

coffeescript

Cppcheck is a static analysis tool for C/C++ code

linter

c++, c

Static code checker for C++

linter

c++

Formatter for CockroachDB's additions to the Go style guide

formatter

go

Tools for the Crystal programming language

formatter

crystal

An Opinionated Code Formatter for C#

formatter

c#

A css formatter

formatter

css

CSS coding style formatter

formatter

css

Automated linting of Cascading Stylesheets

linter

css

Validate and define text-based and dynamic configuration

formatter

cue

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

A modern language that turns text to diagrams

formatter

d2

Formatter and linter for Dart

formatter, linter

dart, flutter

Code Quality Tool for Flutter Developers

formatter, linter

dart, flutter

Scan Nix files for dead code

linter

nix

Formatter and linter for JavaScript and TypeScript

formatter, linter

javascript, json, typescript

Dfmt is a formatter for D source code

formatter

d

Format Dhall files

formatter

dhall

A Django template formatter

formatter

django, python

Lint & Format HTML Templates

formatter, linter

handlebars, html, jinja, mustache, nunjucks, twig

Formats docstrings to follow PEP 257

formatter

python

Dockerfile formatter. a modern dockfmt

formatter

docker

Dockerfile format and parser. Like gofmt but for Dockerfiles

formatter

docker

A formatter for Sphinx flavored reStructuredText

formatter

python, restructuredtext, sphinx

Generates table of contents for markdown files

formatter

markdown

Lightning-fast linter for .env files

linter

env

A pluggable and configurable code formatting platform written in Rust

formatter

Swiss-army knife for D source code

linter

d

Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards

formatter, linter

php

Dioxus cli

formatter

rsx, rust

The Easiest way to add coding standard to your PHP project

formatter, linter

php

Erlang code formatter

formatter

erlang

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide

formatter

elm

Removes commented-out code from Python files

linter

python

Format ERB files with speed and precision

formatter

erb, ruby

A statically typed language compatible with Python

linter

erg

An automated code formatter for Erlang

formatter

erlang

Find and fix problems in your JavaScript code

linter

javascript, typescript

FSharp source code formatter

formatter

f#

Fish indenter and prettifier

formatter

fish

JSON Fixer for Humans using (relaxed) JSON5

formatter, linter

json5, json

Floskell is a flexible Haskell source code pretty printer

formatter

haskell

A tool to automatically convert old string literal formatting to f-strings

formatter

python

A formatter for Fennel code

formatter

fennel

A Solidity formatter

formatter

solidity

A Fortran linter, written in Rust

linter

A simple fortran syntax checker, including automatic fixing of the code

formatter, linter

fortran

A formatter for Haskell source code

formatter

haskell

Auto-formatter for modern Fortran source code

formatter

fortran

Code formatter for the furhark programming language

formatter

futhark

Run Dart and Flutter commands through fvm

formatter, linter

dart, flutter

GCI, a tool that control golang package import order and make it always deterministic

formatter

go

GDScript formatter

formatter

gdscript

GDScript linter

linter

gdscript

A formatter to make your CMake code the real treasure

formatter

cmake

Format Gleam source code

formatter

gleam

Code formatting for the gluon programming language

formatter

gluon

Gofmt formats Go programs

formatter

go

A stricter gofmt

formatter

go

Right imports sorting & code formatting tool (goimports alternative)

formatter

go

goimports updates your Go import lines, adding missing ones and removing unreferenced ones

formatter

go

Fast linters runner for Go

formatter, linter

go

A golang formatter that fixes long lines

formatter

go

Reformats Java source code to comply with Google Java Style

formatter

java

Misspelled word linter for Go comments, string literals and embedded files

spell-check

go

The Grafbase command line interface

linter

graphql

Code formatter for the Grain programming language

formatter

grain

Dockerfile linter, validate inline bash, written in Haskell

linter

dockerfile

Tool for writing clean and consistent HAML

linter

haml

Formatter for hcl files

formatter

hcl

Format Haskell programs. Inspired by the gofmt utility

formatter

haskell

Extensible Haskell pretty printer

formatter

haskell

Haskell source code suggestions

linter

haskell

A html formatter

formatter

html

A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates

formatter

erb, html, ruby

The static code analysis tool you need for your HTML

linter

html

Formatter for hurl files

formatter

hurl

A formatter for Imba

formatter

imba

Code formatter for the inko programming language

formatter

inko

A Python utility to sort imports

formatter

python

A formatter for Janet code.

formatter

janet

Small Clojure interpreter, linter and formatter

formatter, linter

clojure

JSON processor

formatter

json

like gofmt, but for jq

formatter

jq

A JavaScript formatter

formatter

javascript

JSON5 (a.k.a., JSON for Humans) formatter that preserves contextual comments

formatter

json5, json

JSONA linter and formatter

formatter, linter

jsona

A JSON parser and validator with a CLI

formatter, linter

json

Linter for jsonnet files

linter

jsonnet

Formatter for automatically fixing jsonnet stylistic problems

formatter

jsonnet

A fast command line JSON pretty printer

formatter

json

An opinionated code formatter for Julia. Plot twist - the opinion is your own

formatter

julia

A formatter for justfiles

formatter

just

KCL Format tool supports reformatting KCL files to the standard code style

formatter

kcl

A formatter for kdl documents

formatter

kdl

Reformats Kotlin KDoc comments, reflowing text and other cleanup

formatter

kotlin

program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions

formatter

kotlin

An anti-bikeshedding Kotlin linter with built-in formatter

linter

kotlin

An opinionated .http and .rest file linter and formatter

formatter

http

A formatter for the leptos view! macro

formatter

rust

Prettier plugin for liquidsoap script

formatter

liquidsoap

A tool for linting and static analysis of Lua code

formatter

lua

Code formatter for Lua

formatter

lua

A fast Markdown linter written in Rust

linter

markdown

A fast linter and formatter for PHP

formatter, linter

php

Like gofmt, but for Markdown

formatter

markdown

A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library

linter

markdown

A Node.js style checker and lint tool for Markdown/CommonMark files

linter

markdown

An HTML linter for all markup developers

linter

html

Fix mixed spaces in Markdown: Chinese and English, numbers, links

formatter

markdown

CommonMark compliant Markdown formatter

formatter

markdwon

Run mdsf inside mdsf

formatter

markdown

Prepare your markdown for easy diff'ing!

formatter

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

The front-end to your dev env

Correct commonly misspelled English words in source files

spell-check

Code formatter for Elixir

formatter

elixir

Formats Mojo source files

formatter

mojo

An implementation of the meson build system

formatter, linter

meson

Optional static typing for Python

linter

python

Formatter for NASM source files

formatter

assembly

Format and beautify nginx config files

formatter

nginx

nginx config file formatter/beautifier written in Python with no additional dependencies

formatter

nginx

Better configuration for less

formatter

nickel

Code formatter for the Nim programming language

formatter

nim

The official (but not yet stable) formatter for Nix code

formatter

nix

Nix code formatter for nixpkgs

formatter

nix

CLI for HashiCorp Nomad

formatter

hcl

An opinionated code formatter for Nim

formatter

nim

Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files

formatter, linter

groovy

the nushell formatter

formatter

nushell

Auto-formatter for OCaml code

formatter

ocaml

Indentation tool for OCaml

formatter

ocaml

Formatter for the Odin programming language

formatter

odin

Advanced oelint

linter

bitbake

Format Rego source files

formatter

rego

A formatter for Haskell source code

formatter

haskell

Oxlint is designed to catch erroneous or useless code without requiring any configurations by default

linter

javascript, typescript

Packer is used to format HCL2 configuration files

formatter

hcl

Delphi code formatter

formatter

delphi, pascal

Python Linter for performance anti patterns

linter

python

Perl::Tidy, a source code formatter for Perl

formatter

perl

A PostgreSQL SQL syntax beautifier

formatter

sql

A tool to automatically fix PHP Coding Standards issues

formatter, linter

php

PHP Code Beautifier and Fixer fixes violations of a defined coding standard

formatter

php

Instant PHP quality checks from your console

linter

php

Laravel Pint is an opinionated PHP code style fixer for minimalists

formatter, linter

php

Prettier is an opinionated code formatter

formatter

angular, css, ember, graphql, handlebars, html, javascript, json, less, markdown, scss, typescript, vue

The opinionated PHP code formatter

formatter

php

Formatter for Typst

formatter

typst

Commands for interacting with the prisma ORM

formatter

prisma

A linter for prose

spell-check

A pluggable linter and fixer to enforce Protocol Buffer style and conventions

linter

protobuf

Free Pascal source formatter

formatter

pascal

An unopinionated and configurable linter and style checker for Pug

linter

pug

Check that your Puppet manifests conform to the style guide

linter

puppet

PureScript code formatter

formatter

purescript

PureScript pretty-printer

formatter

purescript

A formatter for finding and removing unused import statements

formatter

python

Simple Python style checker in one Python file

linter

python

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

docstring style checker

formatter

python

A simple program which checks Python source files for errors

linter

python

Pyink is a Python formatter, forked from Black with a few different formatting behaviors

formatter

python

Pylint is a static code analyser for Python 2 or 3

linter

python

Format and convert Python docstrings and generates patches

formatter

python

A tool to automatically upgrade Python syntax to newer versions

linter

python

Command line application that formats QML files

formatter

qml

quick-lint-js finds bugs in JavaScript programs

linter

javascript

An extensible code formatter for Racket

formatter

racket

Code smell detector for Ruby

linter

ruby

refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason

formatter

reason

Reformat-gherkin automatically formats Gherkin files

formatter

gherkin

A tool for refurbishing and modernizing Python codebases

linter

python

Regal is a linter and language server for Rego, bringing your policy development experience to the next level

linter

rego

Rewrites source to reorder python imports

formatter

python

Formatter for ReScript

formatter

rescript

~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint

linter

go

Tools for the roc programming language

formatter

roc

A formatter for reStructuredText

formatter

restructuredtext

A Ruby static code analyzer and formatter, based on the community Ruby style guide

formatter, linter

ruby

Ruby Autoformatter

formatter

ruby

An extremely fast Python linter and code formatter, written in Rust

formatter, linter

python

The Ruby Formatter

formatter

ruby

Tools for the Rune programming language

formatter

rune

Julia code formatter

formatter

julia

The official code formatter for Rust

formatter

rust

CLI for organizing Tailwind CSS classes

formatter

html

A command-line utility that checks for best practices in SaltStack

linter

salt

Code formatter for Scala

formatter

scala

Scala source code formatter

formatter

scala

A blazing-fast modern Lua linter written in Rust

linter

lua

All the goodness of standardjs with semicolons sprinkled on top

formatter, linter

javascript

ShellCheck, a static analysis tool for shell scripts

linter

bash, shell

The corrective bash syntax highlighter

linter

bash, shell

Shell script formatter

formatter

shell

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

Tool for analyzing Slim templates

linter

slim

A custom parser/auto-formatter for Standard ML

formatter

standard-ml

The uncompromising Snakemake code formatter

formatter

snakemake

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 whitespace formatter for different query languages

formatter

sql

A modular SQL linter and auto-formatter with support for multiple dialects and templated code

formatter, linter

sql

sqlfmt formats your dbt SQL files so you don't have to

formatter

sql

Fast SQL formatter/linter

formatter, linter

sql

Linter for Postgres migrations & SQL

linter

postgresql, sql

JavaScript style guide, linter, and formatter

formatter, linter

javascript

Ruby's bikeshed-proof linter and formatter

formatter, linter

ruby

lints and suggestions for the nix programming language

linter

nix

stylefmt is a tool that automatically formats stylesheets

formatter

css, scss

A mighty CSS linter that helps you avoid errors and enforce conventions

linter

css, scss

Haskell code prettifier

formatter

haskell

An opinionated Lua code formatter

formatter

lua

HTML Language Server & Templating Language Library

formatter

html

SystemVerilog linter

linter

systemverilog

Formatting technology for Swift source code

formatter

swift

A command-line tool and Xcode Extension for formatting Swift code

formatter

swift

A TOML toolkit written in Rust

formatter

toml

Tooling for the Templ template language

formatter

go, templ

The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style

formatter

terraform

Recursively find hcl files and rewrite them into a canonical format

formatter

hcl

An extremely fast LaTeX formatter written in Rust

formatter

latex

The pluggable natural language linter for text and markdown

spell-check

Tighten linter for Laravel conventions

linter

php

The tofu fmt command is used to rewrite OpenTofu configuration files to a canonical format and style

formatter

terraform, tofu

A command line utility to sort and format toml files

formatter

toml

Topiary aims to be a uniform formatter for simple languages, as part of the Tree-sitter ecosystem

formatter

A linter to prevent exception handling antipatterns in Python

linter

python

Typescript style guide, linter, and formatter using StandardJS

formatter, linter

typescript

CLI for managing TypeSpec configurations

formatter

typespec

Configurable linting for TSQL

linter

sql

A tool to automatically fix Twig Coding Standards issues

formatter, linter

twig

The missing checkstyle for twig

linter

php, twig

An extremely fast Python type checker written in Rust

linter

python

Source code spell checker

spell-check

Basic formatter for the Typst language

formatter

typst

Beautiful and reliable typst code formatter

formatter

typst

Safe, atomic formatting with black and usort

formatter

python

A stack-based array programming language

formatter

uiua

The ultimate linter and formatter for removing unused import statements in your code

formatter

python

Safe, minimal import sorting for Python projects

formatter

python

Tooling for V lang

formatter

v

vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool

linter

json, openapi, yaml

An Opinionated Formatter for Verus

formatter

rust, verus

Veryl: A Modern Hardware Description Language

formatter

veryl

Style guide enforcement for VHDL

formatter

vhdl

Lint Vim script

linter

vimscript

Formatter for the wa programming language

formatter

wa

Indents and optionally converts Fortran program sources

formatter

fortran

Naive linter for English prose

linter

Format and compress XML documents

formatter

xml

XML linter

linter

xml

JavaScript/TypeScript linter (ESLint wrapper) with great defaults

linter

javascript, typescript

Command-line XML and HTML beautifier and content extractor

formatter

html, xml

A simple opinionated yaml formatter that keeps your comments

formatter

yaml

An extensible command line tool or library to format yaml files

formatter

yaml

A linter for YAML files

linter

yaml

A formatter for Python files

formatter

python

Code formatter for the Yew framework

formatter

rust

yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor

formatter

yaml

Reformat Zig source into canonical form

formatter

zig

Formats Ziggy documents and Ziggy schemas

formatter

ziggy

Executables beautifully format Clojure and Clojurescript source code and s-expressions

formatter

clojure, clojurescript

Commands

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

Name
Command

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

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

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

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

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

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

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

mdsf completions nushell

Acknowledgement

Alternatives to mdsf

The latest version of mdsf can be downloaded directly from .

Install using the :

If you do not have Cargo installed, you need to .

You can install mdsf using :

An unofficial (and unsupported) Conda package can be found at .

has native support for running mdsf.

Add the following to your treefmt.toml to run mdsf using .

Generate completions for .

mdsf was inspired by the amazing neovim formatting plugin .

using injected mode.

.

github.com/hougesen/mdsf/releases
published crate
install it first
npm
https://anaconda.org/conda-forge/mdsf
conform.nvim
treefmt
nushell
conform.nvim
conform.nvim
mdformat
actionlint
air
alejandra
alex
ameba
ansible-lint
asmfmt
astyle
atlas
auto-optional
autocorrect
autoflake
autopep8
bashate
beancount-black
beautysh
bibtex-tidy
bicep
biome
black
blade-formatter
blue
bpfmt
brittany
brunette
bsfmt
bslint
buf
buildifier
cabal-fmt
cabal-prettify
cabal
caddy
caramel
cfn-lint
checkmake
clang-format
clang-tidy
clj-kondo
cljfmt
cljstyle
cmake-format
cmake-lint
codeql
codespell
coffeelint
cppcheck
cpplint
crlfmt
crystal
csharpier
css-beautify
csscomb
csslint
cue
cueimports
curlylint
d2
dart
dcm
deadnix
deno
dfmt
dhall
djade
djlint
docformatter
dockerfmt
dockfmt
docstrfmt
doctoc
dotenv-linter
dprint
dscanner
duster
dx
easy-coding-standard
efmt
elm-format
eradicate
erb-formatter
erg
erlfmt
eslint
fantomas
fish_indent
fixjson
floskell
flynt
fnlfmt
forge
fortitude
fortran-linter
fourmolu
fprettify
futhark
fvm
gci
gdformat
gdlint
gersemi
gleam
gluon
gofmt
gofumpt
goimports-reviser
goimports
golangci-lint
golines
google-java-format
gospel
grafbase
grain
hadolint
haml-lint
hclfmt
hfmt
hindent
hlint
html-beautify
htmlbeautifier
htmlhint
hurlfmt
imba
inko
isort
janet-format
joker
jq
jqfmt
js-beautify
json5format
jsona
jsonlint
jsonnet-lint
jsonnetfmt
jsonpp
juliaformatter.jl
just
kcl
kdlfmt
kdoc-formatter
ktfmt
ktlint
kulala-fmt
leptosfmt
liquidsoap-prettier
luacheck
luaformatter
mado
mago
markdownfmt
markdownlint-cli2
markdownlint
markuplint
md-padding
mdformat
mdsf
mdslw
meson
mise
misspell
mix
mojo
muon
mypy
nasmfmt
nginxbeautifier
nginxfmt
nickel
nimpretty
nixfmt
nixpkgs-fmt
nomad
nph
npm-groovy-lint
nufmt
ocamlformat
ocp-indent
odinfmt
oelint-adv
opa
ormolu
oxlint
packer
pasfmt
perflint
perltidy
pg_format
php-cs-fixer
phpcbf
phpinsights
pint
prettier
pretty-php
prettypst
prisma
proselint
protolint
ptop
pug-lint
puppet-lint
purs-tidy
purty
pycln
pycodestyle
pydoclint
pydocstringformatter
pydocstyle
pyflakes
pyink
pylint
pyment
pyupgrade
qmlfmt
quick-lint-js
raco
reek
refmt
reformat-gherkin
refurb
regal
reorder-python-imports
rescript
revive
roc
rstfmt
rubocop
rubyfmt
ruff
rufo
rune
runic
rustfmt
rustywind
salt-lint
scalafmt
scalariform
selene
semistandard
shellcheck
shellharden
shfmt
sleek
slim-lint
smlfmt
snakefmt
solhint
sphinx-lint
sql-formatter
sqlfluff
sqlfmt
sqruff
squawk
standardjs
standardrb
statix
stylefmt
stylelint
stylish-haskell
stylua
superhtml
svlint
swift-format
swiftformat
taplo
templ
terraform
terragrunt
tex-fmt
textlint
tlint
tofu
toml-sort
topiary
tryceratops
ts-standard
tsp
tsqllint
twig-cs-fixer
twigcs
ty
typos
typstfmt
typstyle
ufmt
uiua
unimport
usort
v
vacuum
verusfmt
veryl
vhdl-style-guide
vint
wa
wfindent
write-good
xmlformat
xmllint
xo
xq
yamlfix
yamlfmt
yamllint
yapf
yew-fmt
yq
zig
ziggy
zprint
Table of contents
Installation
Linux & MacOS
Windows
Cargo
npm/npx
Homebrew
Conda
Usage
Formatting code
Caching formatting results
Removing old caches
Verifying code
GitHub Action
Visual Studio Code
Vim / NeoVim
conform.nvim
treefmt
Configuration
Language aliases
Newlines
Tools
Commands
Shell completions
Bash
Zsh
Fish
PowerShell
Elvish
Nushell
Acknowledgement
Alternatives to mdsf