https://github.com/hougesen/mdsf
Format markdown code blocks using your favorite tools
https://github.com/hougesen/mdsf
cli codeblocks codeformatter command-line documentation elixir formatter gleam go hacktoberfest json markdown md pretty-printer python rust typescript zig
Last synced: 3 months ago
JSON representation
Format markdown code blocks using your favorite tools
- Host: GitHub
- URL: https://github.com/hougesen/mdsf
- Owner: hougesen
- License: mit
- Created: 2024-02-18T17:01:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T20:55:00.000Z (about 1 year ago)
- Last Synced: 2025-04-01T22:57:17.671Z (about 1 year ago)
- Topics: cli, codeblocks, codeformatter, command-line, documentation, elixir, formatter, gleam, go, hacktoberfest, json, markdown, md, pretty-printer, python, rust, typescript, zig
- Language: Rust
- Homepage: https://mdsf.mhouge.dk
- Size: 3.52 MB
- Stars: 45
- Watchers: 3
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- trackawesomelist - mdsf (⭐22)
- awesome-python-code-formatters - mdsf
- fucking-static-analysis - mdsf
- static-analysis - mdsf
- awesome-markdown - mdsf - Use your preferred code formatter to format markdown code snippets. (Markdown Building Blocks / Markdown Lint / Style Rule Checker)
README
# mdsf
Format, and lint, markdown code snippets using your favorite tools.
## Table of contents
- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Linux & MacOS](#linux--macos)
- [Windows](#windows)
- [Cargo](#cargo)
- [npm/npx](#npmnpx)
- [Homebrew](#homebrew)
- [Conda](#conda)
- [Usage](#usage)
- [Formatting code](#formatting-code)
- [Caching formatting results](#caching-formatting-results)
- [Removing old caches](#removing-old-caches)
- [Verifying code](#verifying-code)
- [GitHub Action](#github-action)
- [Visual Studio Code](#visual-studio-code)
- [Vim / NeoVim](#vim--neovim)
- [conform.nvim](#conformnvim)
- [treefmt](#treefmt)
- [pre-commit](#pre-commit)
- [Configuration](#configuration)
- [Language aliases](#language-aliases)
- [Newlines](#newlines)
- [Custom tools and commands](#custom-tools-and-commands)
- [Tools](#tools)
- [Commands](#commands)
- [Shell completions](#shell-completions)
- [Bash](#bash)
- [Zsh](#zsh)
- [Fish](#fish)
- [PowerShell](#powershell)
- [Elvish](#elvish)
- [Nushell](#nushell)
- [Rust MSRV](#rust-msrv)
- [Acknowledgement](#acknowledgement)
- [Alternatives to mdsf](#alternatives-to-mdsf)
## Installation
The latest version of `mdsf` can be downloaded directly from [github.com/hougesen/mdsf/releases](https://github.com/hougesen/mdsf/releases).
### Linux & MacOS
```shell
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hougesen/mdsf/releases/latest/download/mdsf-installer.sh | sh
```
### Windows
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://github.com/hougesen/mdsf/releases/latest/download/mdsf-installer.ps1 | iex"
```
### Cargo
Install using the [published crate](https://crates.io/crates/mdsf):
```shell
cargo install mdsf --locked
```
or directly from source:
```shell
git clone git@github.com:hougesen/mdsf.git
cargo install --path ./mdsf --bin mdsf
```
If you do not have Cargo installed, you need to [install it first](https://www.rust-lang.org/learn/get-started).
### npm/npx
You can install `mdsf` using [npm](https://www.npmjs.com/package/mdsf-cli):
```shell
npm install -g mdsf-cli
mdsf format .
```
or run it directly using npx:
```shell
npx mdsf-cli format .
```
### Homebrew
```shell
brew install hougesen/tap/mdsf
```
### Conda
An _unofficial_ (and unsupported) Conda package can be found at [https://anaconda.org/conda-forge/mdsf](https://anaconda.org/conda-forge/mdsf).
```shell
conda install conda-forge::mdsf
```
## Usage
```
mdsf 0.12.0-next
Format, and lint, markdown code snippets using your favorite tools
Mads Hougesen
Usage: mdsf [OPTIONS]
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 [default: debug] [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.
```shell
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
Path to config file
--debug
Log stdout and stderr of formatters
--threads
Amount of threads to use.
Defaults to 0 (auto).
--cache
Cache results
--log-level
[default: debug]
[possible values: trace, debug, info, warn, error, off]
--timeout
Tool timeout in seconds.
Defaults to no timeout.
--on-missing-language-definition
What to do when a codeblock language has no tools defined.
Falls back to the value defined in your config file, if no argument is provided.
[possible values: ignore, fail, fail-fast]
--on-missing-tool-binary
What to do when the binary of a tool cannot be found.
Falls back to the value defined in your config file, if no argument is provided.
[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.
```shell
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 [default: debug] [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.
```shell
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
Path to config file
--debug
Log stdout and stderr of formatters
--threads
Amount of threads to use.
Defaults to 0 (auto).
--timeout
Tool timeout in seconds.
Defaults to no timeout.
--log-level
[default: debug]
[possible values: trace, debug, info, warn, error, off]
--on-missing-language-definition
What to do when a codeblock language has no tools defined.
Falls back to the value defined in your config file, if no argument is provided.
[possible values: ignore, fail, fail-fast]
--on-missing-tool-binary
What to do when the binary of a tool cannot be found.
Falls back to the value defined in your config file, if no argument is provided.
[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.
```yaml
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
[](https://marketplace.visualstudio.com/items?itemName=hougesen.mdsf)
[](https://open-vsx.org/extension/hougesen/mdsf)
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](https://github.com/stevearc/conform.nvim) has native support for running mdsf.
```lua
local conform = require("conform")
conform.setup({
formatters_by_ft = {
markdown = { "mdsf" },
-- ...
},
-- ...
})
```
### treefmt
Add the following to your `treefmt.toml` to run mdsf using [treefmt](https://github.com/numtide/treefmt).
```toml
# treefmt.toml
[formatter.mdsf]
command = "mdsf"
options = ["format"]
includes = ["*.md"]
```
### pre-commit
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
Sample `.pre-commit-config.yaml`:
```yaml
repos:
- repo: https://github.com/hougesen/mdsf
rev: main
hooks:
- id: mdsf-format
```
## 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
--format
[default: json] [possible values: json, toml, yaml]
--schema-version
[default: locked] [possible values: locked, stable, development]
--log-level
[default: debug] [possible values: trace, debug, info, warn, error, off]
-h, --help
Print help
-V, --version
Print version
```
`mdsf` supports running multiple formatters on the code snippet.
```json
{
"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.
```json
{
"language_aliases": {
"language": "is_alias_of"
}
}
```
In the example below `bash` and `zsh` would use the tools defined under `languages.shell`.
```json
{
"languages": {
"shell": "shfmt"
},
"language_aliases": {
"bash": "shell",
"zsh": "shell"
}
}
```
### Newlines
By default LF (`\n`) is used for newlines.
That can be changed by specifying the `newline` config option.
```json
{
"newline": "lf" // "lf" | "cr" | "crlf"
}
```
### Custom tools and commands
Custom commands can be defined in the `mdsf.json` file.
When defining the arguments the variable `$PATH` will automatically be replaced with the file path.
```json
{
"languages": {
"rust": {
"binary": "rustfmt",
"arguments": ["--edition", "2018", "$PATH"],
"stdin": false
}
}
}
```
### Tools
> \[!NOTE\]
> mdsf is not a package manager.
>
> Only tools that are already installed will be used.
`mdsf` currently supports 346 tools. Feel free to open an issue/pull-request if your favorite tool/command is missing! 😃
| Name | Description | Categories | Languages |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [action-validator](https://github.com/mpalmer/action-validator) | Tool to validate GitHub Action and Workflow YAML files | `linter` | `yaml` |
| [actionlint](https://github.com/rhysd/actionlint) | Static checker for GitHub Actions workflow files | `linter` | `yaml` |
| [air](https://github.com/posit-dev/air) | R formatter | `formatter` | `r` |
| [alejandra](https://github.com/kamadorueda/alejandra) | The Uncompromising Nix Code Formatter | `formatter` | `nix` |
| [alex](https://github.com/get-alex/alex) | Catch insensitive, inconsiderate writing | `spell-check` | `markdown` |
| [ameba](https://github.com/crystal-ameba/ameba) | A static code analysis tool for Crystal | `linter` | `crystal` |
| [ansible-lint](https://github.com/ansible/ansible-lint) | 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` |
| [api-linter](https://github.com/googleapis/api-linter) | A linter for APIs defined in protocol buffers | `linter` | `protobuf` |
| [asmfmt](https://github.com/klauspost/asmfmt) | Go Assembler Formatter | `formatter` | `go` |
| [astyle](https://gitlab.com/saalen/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` |
| [atlas](https://github.com/ariga/atlas) | Manage your database schema as code | `formatter` | `hcl` |
| [auto-optional](https://github.com/luttik/auto-optional) | Makes typed arguments Optional when the default argument is None | `formatter` | `python` |
| [autocorrect](https://github.com/huacnlee/autocorrect) | A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean) | `spell-check` | |
| [autoflake](https://github.com/pycqa/autoflake) | Removes unused imports and unused variables as reported by pyflakes | `linter` | `python` |
| [autopep8](https://github.com/hhatto/autopep8) | A tool that automatically formats Python code to conform to the PEP 8 style guide | `formatter` | `python` |
| [bashate](https://github.com/openstack/bashate) | Code style enforcement for bash programs | `formatter` | `bash` |
| [beancount-black](https://github.com/launchplatform/beancount-black) | Opinionated code formatter, just like Python's black code formatter but for Beancount | `formatter` | `beancount` |
| [beautysh](https://github.com/lovesegfault/beautysh) | A Bash beautifier for the masses | `formatter` | `bash`, `shell` |
| [bibtex-tidy](https://github.com/flamingtempura/bibtex-tidy) | Cleaner and Formatter for BibTeX files | `formatter` | `bibtex` |
| [bicep](https://github.com/azure/bicep) | Bicep is a declarative language for describing and deploying Azure resources | `formatter` | `bicep` |
| [biome](https://github.com/biomejs/biome) | A toolchain for web projects | `formatter`, `linter` | `javascript`, `json`, `typescript`, `vue` |
| [black](https://github.com/psf/black) | The uncompromising Python code formatter | `formatter` | `python` |
| [blade-formatter](https://github.com/shufo/blade-formatter) | An opinionated blade template formatter for Laravel that respects readability | `formatter` | `blade`, `laravel`, `php` |
| [blue](https://github.com/grantjenks/blue) | The slightly less uncompromising Python code formatter | `formatter` | `python` |
| [bpfmt](https://source.android.com/docs/setup/reference/androidbp#formatter) | A formatter for Blueprint files | `formatter` | `blueprint` |
| [brittany](https://github.com/lspitzner/brittany) | Haskell source code formatter | `formatter` | `haskell` |
| [brunette](https://pypi.org/project/brunette) | A best practice Python code formatter | `formatter` | `python` |
| [bsfmt](https://github.com/rokucommunity/brighterscript-formatter) | A code formatter for BrighterScript (and BrightScript) | `formatter` | `brighterscript`, `brightscript` |
| [bslint](https://github.com/rokucommunity/bslint) | A linter for BrightScript and BrighterScript | `linter` | `brightscript`, `brightscripter` |
| [buf](https://buf.build/docs/reference/cli/buf) | The best way of working with Protocol Buffers | `formatter` | `protobuf` |
| [buildifier](https://github.com/bazelbuild/buildtools) | A bazel BUILD file formatter and editor | `formatter` | `bazel` |
| [c3fmt](https://github.com/lmichaudel/c3fmt) | A customizable code formatter for the C3 language | `formatter` | `c3` |
| [cabal-fmt](https://github.com/phadej/cabal-fmt) | An experiment of formatting .cabal files | `formatter` | `cabal` |
| [cabal-gild](https://github.com/tfausak/cabal-gild) | Format Haskell package descriptions | `formatter` | `cabal`, `haskell` |
| [cabal-prettify](https://github.com/kindaro/cabal-prettify) | Prettify your Cabal package configuration files | `formatter` | `cabal` |
| [cabal](https://www.haskell.org/cabal) | Cabal is a system for building and packaging Haskell libraries and programs | `formatter` | `cabal` |
| [caddy](https://caddyserver.com/docs/command-line#caddy-fmt) | Formats or prettifies a Caddyfile | `formatter` | `caddy` |
| [caramel](https://caramel.run) | Formatter for the Caramel programming language | `formatter` | `caramel` |
| [cedar](https://github.com/cedar-policy/cedar) | Command Line Interface for Cedar | `formatter` | `cedar` |
| [cfn-lint](https://github.com/aws-cloudformation/cfn-lint) | CloudFormation Linter | `linter` | `cloudformation`, `json`, `yaml` |
| [checkmake](https://github.com/mrtazz/checkmake) | Linter/analyzer for Makefiles | `linter` | `makefile` |
| [clang-format](https://clang.llvm.org/docs/ClangFormat.html) | 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](https://clang.llvm.org/extra/clang-tidy) | clang-tidy is a clang-based C++ “linter” tool | `linter` | `c++` |
| [clj-kondo](https://github.com/clj-kondo/clj-kondo) | Static analyzer and linter for Clojure code that sparks joy | `linter` | `clojure`, `clojurescript` |
| [cljfmt](https://github.com/weavejester/cljfmt) | A tool for formatting Clojure code | `formatter` | `clojure` |
| [cljstyle](https://github.com/greglook/cljstyle) | A tool for formatting Clojure code | `formatter` | `clojure` |
| [cmake-format](https://cmake-format.readthedocs.io/en/latest/cmake-format.html) | cmake-format can format your listfiles nicely so that they don't look like crap | `formatter` | `cmake` |
| [cmake-lint](https://cmake-format.readthedocs.io/en/latest/lint-usage.html) | Lint CMake files | `linter` | `cmake` |
| [codeql](https://docs.github.com/en/code-security/codeql-cli/codeql-cli-manual) | Format queries and libraries with CodeQL | `formatter` | `codeql` |
| [codespell](https://github.com/codespell-project/codespell) | Check code for common misspellings | `spell-check` | |
| [coffeelint](https://github.com/coffeelint/coffeelint) | Lint your CoffeeScript | `linter` | `coffeescript` |
| [cppcheck](https://cppcheck.sourceforge.io) | Cppcheck is a static analysis tool for C/C++ code | `linter` | `c++`, `c` |
| [cpplint](https://github.com/cpplint/cpplint) | Static code checker for C++ | `linter` | `c++` |
| [crlfmt](https://github.com/cockroachdb/crlfmt) | Formatter for CockroachDB's additions to the Go style guide | `formatter` | `go` |
| [crystal](https://crystal-lang.org) | Tools for the Crystal programming language | `formatter` | `crystal` |
| [csharpier](https://github.com/belav/csharpier) | CSharpier is an opinionated code formatter for C# | `formatter` | `c#` |
| [css-beautify](https://github.com/beautifier/js-beautify) | A CSS formatter | `formatter` | `css` |
| [csscomb](https://github.com/csscomb/csscomb.js) | CSS coding style formatter | `formatter` | `css` |
| [csslint](https://github.com/csslint/csslint) | Automated linting of Cascading Stylesheets | `linter` | `css` |
| [cue](https://github.com/cue-lang/cue) | The home of the CUE language! Validate and define text-based and dynamic configuration | `formatter` | `cue` |
| [cueimports](https://github.com/asdine/cueimports) | CUE tool that updates your import lines, adding missing ones and removing unused ones | `formatter` | `cue` |
| [curlylint](https://github.com/thibaudcolas/curlylint) | Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid | `linter` | `django`, `html`, `jinja`, `liquid`, `nunjucks`, `twig` |
| [d2](https://d2lang.com) | A modern language that turns text to diagrams | `formatter` | `d2` |
| [dart](https://dart.dev/tools) | Formatter and linter for Dart | `formatter`, `linter` | `dart`, `flutter` |
| [dcm](https://dcm.dev) | Code Quality Tool for Flutter Developers | `formatter`, `linter` | `dart`, `flutter` |
| [deadnix](https://github.com/astro/deadnix) | Scan Nix files for dead code | `linter` | `nix` |
| [deno](https://docs.deno.com/runtime/reference/cli) | Formatter and linter for JavaScript and TypeScript | `formatter`, `linter` | `javascript`, `json`, `typescript` |
| [dfmt](https://github.com/dlang-community/dfmt) | Dfmt is a formatter for D source code | `formatter` | `d` |
| [dhall](https://dhall-lang.org) | Tools for the Dhall configuration language | `formatter` | `dhall` |
| [djade](https://github.com/adamchainz/djade) | A Django template formatter | `formatter` | `django`, `python` |
| [djangofmt](https://github.com/unknownplatypus/djangofmt) | A fast, HTML aware, Django template formatter | `formatter` | `django`, `html`, `python` |
| [djlint](https://www.djlint.com) | Lint & Format HTML Templates | `formatter`, `linter` | `handlebars`, `html`, `jinja`, `mustache`, `nunjucks`, `twig` |
| [docformatter](https://github.com/pycqa/docformatter) | Formats docstrings to follow PEP 257 | `formatter` | `python` |
| [dockerfmt](https://github.com/reteps/dockerfmt) | Dockerfile formatter. a modern dockfmt | `formatter` | `docker` |
| [dockfmt](https://github.com/jessfraz/dockfmt) | Dockerfile format and parser. Like `gofmt` but for Dockerfiles | `formatter` | `docker` |
| [docstrfmt](https://github.com/lilspazjoekp/docstrfmt) | A formatter for reStructuredText | `formatter` | `python`, `restructuredtext`, `sphinx` |
| [doctoc](https://github.com/thlorenz/doctoc) | Generates table of contents for markdown files | `formatter` | `markdown` |
| [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | Lightning-fast linter for .env files | `linter` | `env` |
| [dprint](https://dprint.dev) | A pluggable and configurable code formatting platform written in Rust | `formatter` | |
| [dscanner](https://github.com/dlang-community/d-scanner) | Swiss-army knife for D source code | `linter` | `d` |
| [dune](https://github.com/ocaml/dune) | Build tool for OCaml projects | `formatter` | `dune`, `ocaml`, `reasonml` |
| [duster](https://github.com/tighten/duster) | Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards | `formatter`, `linter` | `php` |
| [dx](https://github.com/dioxuslabs/dioxus) | Fullstack app framework for web, desktop, and mobile | `formatter` | `rsx`, `rust` |
| [easy-coding-standard](https://github.com/easy-coding-standard/easy-coding-standard) | The Easiest way to add coding standard to your PHP project | `formatter`, `linter` | `php` |
| [efmt](https://github.com/sile/efmt) | Erlang code formatter | `formatter` | `erlang` |
| [elm-format](https://github.com/avh4/elm-format) | elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide | `formatter` | `elm` |
| [eradicate](https://github.com/pycqa/eradicate) | Removes commented-out code from Python files | `linter` | `python` |
| [erb-formatter](https://github.com/nebulab/erb-formatter) | Format ERB files with speed and precision | `formatter` | `erb`, `ruby` |
| [erg](https://github.com/erg-lang/erg) | A statically typed language compatible with Python | `linter` | `erg` |
| [erlfmt](https://github.com/whatsapp/erlfmt) | An automated code formatter for Erlang | `formatter` | `erlang` |
| [eslint](https://github.com/eslint/eslint) | Find and fix problems in your JavaScript code | `linter` | `javascript`, `typescript` |
| [fantomas](https://github.com/fsprojects/fantomas) | FSharp source code formatter | `formatter` | `f#` |
| [fish_indent](https://fishshell.com/docs/current/cmds/fish_indent.html) | Fish indenter and prettifier | `formatter` | `fish` |
| [fixjson](https://github.com/rhysd/fixjson) | JSON Fixer for Humans using (relaxed) JSON5 | `formatter`, `linter` | `json5`, `json` |
| [floskell](https://github.com/ennocramer/floskell) | Floskell is a flexible Haskell source code pretty printer | `formatter` | `haskell` |
| [flynt](https://github.com/ikamensh/flynt) | A tool to automatically convert old string literal formatting to f-strings | `formatter` | `python` |
| [fnlfmt](https://git.sr.ht/~technomancy/fnlfmt) | A formatter for Fennel code | `formatter` | `fennel` |
| [forge](https://github.com/foundry-rs/foundry) | Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust | `formatter` | `solidity` |
| [fortitude](https://github.com/plasmafair/fortitude) | A Fortran linter | `linter` | `fortran` |
| [fortran-linter](https://github.com/cphyc/fortran-linter) | A simple fortran syntax checker, including automatic fixing of the code | `formatter`, `linter` | `fortran` |
| [fourmolu](https://github.com/fourmolu/fourmolu) | A fourk of ormolu that uses four space indentation and allows arbitrary configuration | `formatter` | `haskell` |
| [fprettify](https://github.com/fortran-lang/fprettify) | Auto-formatter for modern Fortran source code | `formatter` | `fortran` |
| [futhark](https://futhark.readthedocs.io/en/latest/man/futhark-fmt.html) | Code formatter for the furhark programming language | `formatter` | `futhark` |
| [fvm](https://github.com/leoafarias/fvm) | Flutter Version Management: A simple CLI to manage Flutter SDK versions | `formatter`, `linter` | `dart`, `flutter` |
| [gci](https://github.com/daixiang0/gci) | GCI, a tool that control golang package import order and make it always deterministic | `formatter` | `go` |
| [gdformat](https://github.com/scony/godot-gdscript-toolkit) | GDScript formatter | `formatter` | `gdscript` |
| [gdlint](https://github.com/scony/godot-gdscript-toolkit) | GDScript linter | `linter` | `gdscript` |
| [gersemi](https://github.com/blankspruce/gersemi) | A formatter to make your CMake code the real treasure | `formatter` | `cmake` |
| [ghokin](https://github.com/antham/ghokin) | Parallelized formatter with no external dependencies for gherkin (cucumber, behat...) | `formatter` | `behat`, `cucumber`, `gherkin` |
| [gleam](https://gleam.run) | Format Gleam source code | `formatter` | `gleam` |
| [gluon](https://github.com/gluon-lang/gluon) | A static, type inferred and embeddable language written in Rust | `formatter` | `gluon` |
| [gofmt](https://pkg.go.dev/cmd/gofmt) | Gofmt formats Go programs | `formatter` | `go` |
| [gofumpt](https://github.com/mvdan/gofumpt) | A stricter gofmt | `formatter` | `go` |
| [goimports-reviser](https://github.com/incu6us/goimports-reviser) | Right imports sorting & code formatting tool (goimports alternative) | `formatter` | `go` |
| [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) | goimports updates your Go import lines, adding missing ones and removing unreferenced ones | `formatter` | `go` |
| [golangci-lint](https://github.com/golangci/golangci-lint) | Fast linters runner for Go | `formatter`, `linter` | `go` |
| [golines](https://github.com/golangci/golines) | A golang formatter that fixes long lines | `formatter` | `go` |
| [google-java-format](https://github.com/google/google-java-format) | Reformats Java source code to comply with Google Java Style | `formatter` | `java` |
| [gospel](https://github.com/kortschak/gospel) | Misspelled word linter for Go comments, string literals and embedded files | `spell-check` | `go` |
| [grafbase](https://github.com/grafbase/grafbase) | The Grafbase command line interface | `linter` | `graphql` |
| [grain](https://grain-lang.org/docs/tooling/grain_cli) | Code formatter for the Grain programming language | `formatter` | `grain` |
| [hadolint](https://github.com/hadolint/hadolint) | Dockerfile linter, validate inline bash, written in Haskell | `linter` | `dockerfile` |
| [haml-lint](https://github.com/sds/haml-lint) | Tool for writing clean and consistent HAML | `linter` | `haml` |
| [hclfmt](https://github.com/hashicorp/hcl) | Formatter for hcl files | `formatter` | `hcl` |
| [hfmt](https://github.com/danstiner/hfmt) | Format Haskell programs. Inspired by the gofmt utility | `formatter` | `haskell` |
| [hindent](https://github.com/mihaimaruseac/hindent) | Haskell pretty printer | `formatter` | `haskell` |
| [hlint](https://github.com/ndmitchell/hlint) | Haskell source code suggestions | `linter` | `haskell` |
| [hongdown](https://github.com/dahlia/hongdown) | Hongdown is a Markdown formatter that enforces Hong Minhee's Markdown style conventions | `formatter` | `markdown` |
| [html-beautify](https://github.com/beautifier/js-beautify) | A html formatter | `formatter` | `html` |
| [htmlbeautifier](https://github.com/threedaymonk/htmlbeautifier) | A normaliser/beautifier for HTML that also understands embedded Ruby. Ideal for tidying up Rails templates | `formatter` | `erb`, `html`, `ruby` |
| [htmlhint](https://github.com/htmlhint/htmlhint) | The static code analysis tool you need for your HTML | `linter` | `html` |
| [hurlfmt](https://hurl.dev) | Formatter for hurl files | `formatter` | `hurl` |
| [imba](https://imba.io) | A formatter for Imba | `formatter` | `imba` |
| [inko](https://github.com/inko-lang/inko) | A language for building concurrent software with confidence | `formatter` | `inko` |
| [isort](https://github.com/timothycrosley/isort) | A Python utility to sort imports | `formatter` | `python` |
| [janet-format](https://github.com/janet-lang/spork) | A formatter for Janet code | `formatter` | `janet` |
| [joker](https://github.com/candid82/joker) | Small Clojure interpreter, linter and formatter | `formatter`, `linter` | `clojure` |
| [jq](https://github.com/jqlang/jq) | Command-line JSON processor | `formatter` | `json` |
| [jqfmt](https://github.com/noperator/jqfmt) | like gofmt, but for jq | `formatter` | `jq` |
| [js-beautify](https://github.com/beautifier/js-beautify) | Beautifier for javascript | `formatter` | `javascript` |
| [json5format](https://github.com/google/json5format) | JSON5 formatter that preserves contextual comments | `formatter` | `json5`, `json` |
| [json_repair](https://github.com/mangiucugna/json_repair) | A module to repair invalid JSON from LLMs | `linter` | `json` |
| [jsona](https://github.com/jsona/jsona) | JSONA parser, linter, formatter, lsp and cli | `formatter`, `linter` | `jsona` |
| [jsonlint](https://github.com/zaach/jsonlint) | A JSON parser and validator | `formatter`, `linter` | `json` |
| [jsonnet-lint](https://jsonnet.org/learning/tools.html) | Linter for jsonnet files | `linter` | `jsonnet` |
| [jsonnetfmt](https://jsonnet.org/learning/tools.html) | Formatter for automatically fixing jsonnet stylistic problems | `formatter` | `jsonnet` |
| [jsonpp](https://github.com/jmhodges/jsonpp) | A fast command line JSON pretty printer | `formatter` | `json` |
| [juliaformatter.jl](https://github.com/domluna/juliaformatter.jl) | An opinionated code formatter for Julia. Plot twist - the opinion is your own | `formatter` | `julia` |
| [just](https://github.com/casey/just) | Just a command runner | `formatter` | `just` |
| [kcl](https://www.kcl-lang.io/docs/tools/cli/kcl/fmt) | KCL Format tool supports reformatting KCL files to the standard code style | `formatter` | `kcl` |
| [kdlfmt](https://github.com/hougesen/kdlfmt) | A formatter for kdl documents | `formatter` | `kdl` |
| [kdoc-formatter](https://github.com/tnorbye/kdoc-formatter) | Reformats Kotlin KDoc comments, reflowing text and other cleanup | `formatter` | `kotlin` |
| [keep-sorted](https://github.com/google/keep-sorted) | keep-sorted is a language-agnostic formatter that sorts lines between two markers in a larger file | `formatter` | |
| [ktfmt](https://github.com/facebook/ktfmt) | A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions | `formatter` | `kotlin` |
| [ktlint](https://github.com/pinterest/ktlint) | An anti-bikeshedding Kotlin linter with built-in formatter | `linter` | `kotlin` |
| [kube-linter](https://github.com/stackrox/kube-linter) | KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices | `linter` | `kubernetes`, `yaml` |
| [kulala-fmt](https://github.com/mistweaverco/kulala-fmt) | An opinionated .http and .rest files linter and formatter | `formatter` | `http` |
| [leptosfmt](https://github.com/bram209/leptosfmt) | A formatter for the leptos view! macro | `formatter` | `rust` |
| [liquidsoap-prettier](https://github.com/savonet/liquidsoap-prettier) | Prettier plugin for liquidsoap script | `formatter` | `liquidsoap` |
| [luacheck](https://github.com/lunarmodules/luacheck) | A tool for linting and static analysis of Lua code | `formatter` | `lua` |
| [luaformatter](https://github.com/koihik/luaformatter) | Code formatter for Lua | `formatter` | `lua` |
| [luau-analyze](https://luau.org) | Typecheck and lint luau files | `linter` | `luau` |
| [mado](https://github.com/akiomik/mado) | A fast Markdown linter written in Rust | `linter` | `markdown` |
| [mago](https://github.com/carthage-software/mago) | Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code | `formatter`, `linter` | `php` |
| [markdownfmt](https://github.com/shurcool/markdownfmt) | Like gofmt, but for Markdown | `formatter` | `markdown` |
| [markdownlint-cli2](https://github.com/davidanson/markdownlint-cli2) | A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library | `linter` | `markdown` |
| [markdownlint](https://github.com/davidanson/markdownlint) | A Node.js style checker and lint tool for Markdown/CommonMark files | `linter` | `markdown` |
| [markuplint](https://markuplint.dev) | An HTML linter for all markup developers | `linter` | `html` |
| [mbake](https://github.com/ebodshojaei/bake) | mbake is a Makefile formatter and linter | `formatter`, `linter` | `make` |
| [md-padding](https://github.com/harttle/md-padding) | AST-based padding for Markdown and natural language, improving readability in multilingual documents | `formatter` | `markdown` |
| [mdformat](https://github.com/executablebooks/mdformat) | CommonMark compliant Markdown formatter | `formatter` | `markdwon` |
| [mdsf](https://github.com/hougesen/mdsf) | Run mdsf inside mdsf | `formatter` | `markdown` |
| [mdslw](https://github.com/razziel89/mdslw) | Prepare your markdown for easy diff'ing! | `formatter` | `markdown` |
| [meson](https://mesonbuild.com) | Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible | `formatter` | `meson` |
| [mh_lint](https://github.com/florianschanda/miss_hit) | A linter for MATLAB | `linter` | `matlab` |
| [mh_style](https://github.com/florianschanda/miss_hit) | A formatter for MATLAB | `formatter` | `matlab` |
| [mise](https://github.com/jdx/mise) | dev tools, env vars, task runner | | |
| [misspell](https://github.com/client9/misspell) | Correct commonly misspelled English words in source files | `spell-check` | |
| [mix](https://hexdocs.pm/mix/main/Mix.Tasks.Format.html) | Code formatter for Elixir | `formatter` | `elixir` |
| [mojo](https://docs.modular.com/mojo/cli/format) | Formats Mojo source files | `formatter` | `mojo` |
| [muon](https://github.com/muon-build/muon) | An implementation of the meson build system in c99 | `formatter`, `linter` | `meson` |
| [mypy](https://github.com/python/mypy) | Optional static typing for Python | `linter` | `python` |
| [nasmfmt](https://github.com/yamnikov-oleg/nasmfmt) | Formatter for NASM source files | `formatter` | `assembly` |
| [nginxbeautifier](https://github.com/vasilevich/nginxbeautifier) | Format and beautify nginx config files | `formatter` | `nginx` |
| [nginxfmt](https://github.com/slomkowski/nginx-config-formatter) | nginx config file formatter/beautifier written in Python with no additional dependencies | `formatter` | `nginx` |
| [nickel](https://nickel-lang.org) | Better configuration for less | `formatter` | `nickel` |
| [nimpretty](https://github.com/nim-lang/nim) | Code formatter for the Nim programming language | `formatter` | `nim` |
| [nixfmt](https://github.com/nixos/nixfmt) | The official formatter for Nix code | `formatter` | `nix` |
| [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) | Nix code formatter for nixpkgs | `formatter` | `nix` |
| [nomad](https://developer.hashicorp.com/nomad/docs/commands) | CLI for HashiCorp Nomad | `formatter` | `hcl` |
| [nph](https://github.com/arnetheduck/nph) | An opinionated code formatter for Nim | `formatter` | `nim` |
| [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) | Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files | `formatter`, `linter` | `groovy` |
| [nufmt](https://github.com/nushell/nufmt) | The nushell formatter | `formatter` | `nushell` |
| [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) | Auto-formatter for OCaml code | `formatter` | `ocaml` |
| [ocp-indent](https://github.com/ocamlpro/ocp-indent) | Indentation tool for OCaml | `formatter` | `ocaml` |
| [odinfmt](https://github.com/danielgavin/ols) | Formatter for the Odin programming language | `formatter` | `odin` |
| [oelint-adv](https://github.com/priv-kweihmann/oelint-adv) | Advanced oelint | `linter` | `bitbake` |
| [opa](https://www.openpolicyagent.org/docs/latest/cli) | Format Rego source files | `formatter` | `rego` |
| [ormolu](https://github.com/tweag/ormolu) | A formatter for Haskell source code | `formatter` | `haskell` |
| [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) | Oxfmt a fast JavaScript/TypeScript formatter written in Rust | `formatter` | `javascript`, `typescript` |
| [oxlint](https://oxc.rs/docs/guide/usage/linter.html) | Oxlint is designed to catch erroneous or useless code without requiring any configurations by default | `linter` | `javascript`, `typescript` |
| [packer](https://developer.hashicorp.com/packer/docs/commands) | Packer is used to format HCL2 configuration files | `formatter` | `hcl` |
| [panache](https://github.com/jolars/panache) | A formatter and linter for Pandoc markdown, Quarto, and RMarkdown | `formatter` | `markdown`, `pandoc`, `quarto`, `rmarkdown` |
| [pasfmt](https://github.com/integrated-application-development/pasfmt) | Delphi code formatter | `formatter` | `delphi`, `pascal` |
| [perflint](https://github.com/tonybaloney/perflint) | Python Linter for performance anti patterns | `linter` | `python` |
| [perltidy](https://github.com/perltidy/perltidy) | Perl::Tidy, a source code formatter for Perl | `formatter` | `perl` |
| [pg_format](https://github.com/darold/pgformatter) | A PostgreSQL SQL syntax beautifier | `formatter` | `sql` |
| [php-cs-fixer](https://github.com/php-cs-fixer/php-cs-fixer) | A tool to automatically fix PHP Coding Standards issues | `formatter`, `linter` | `php` |
| [phpcbf](https://github.com/phpcsstandards/php_codesniffer) | PHP Code Beautifier and Fixer fixes violations of a defined coding standard | `formatter` | `php` |
| [phpinsights](https://github.com/nunomaduro/phpinsights) | Instant PHP quality checks from your console | `linter` | `php` |
| [pint](https://github.com/laravel/pint) | Laravel Pint is an opinionated PHP code style fixer for minimalists | `formatter`, `linter` | `php` |
| [pkl](https://github.com/apple/pkl) | A configuration as code language with rich validation and tooling | `formatter` | `pkl` |
| [prettier](https://github.com/prettier/prettier) | Prettier is an opinionated code formatter | `formatter` | `angular`, `css`,