Monorepo for dprint—a pluggable and configurable code formatting platform.
This repository ships a flake.nix that builds the CLI from this source and, on Linux, wraps it in a bubblewrap sandbox.
nix run github:systemfsoftware/dprint
nix build github:systemfsoftware/dprint#dprintOutputs:
dprint-unwrapped: the source build of the CLI.dprint(anddefault): on Linux, the same binary inside the sandbox; on Darwin, for now, the unwrapped binary.
On Linux the sandbox sees /nix/store read-only, a private tmpfs /tmp, a synthetic home directory, /etc/resolv.conf, /etc/hosts and /etc/nsswitch.conf when present, the project root read-write (the git toplevel when the working directory is inside a work tree, otherwise the working directory), and dprint's cache directory read-write ($DPRINT_CACHE_DIR, default ${XDG_CACHE_HOME:-$HOME/.cache}/dprint). The host environment is cleared except for TERM, LANG, LC_ALL, NO_COLOR, FORCE_COLOR and proxy variables, and PATH is rebuilt from /nix/store entries only. Network is available by default so any https: or npm: plugin a dprint.json names resolves on a cold cache; set DPRINT_OFFLINE=1 to run with no network and a read-only cache. A project or cache directory that is empty, /, the home directory, or contains characters outside [A-Za-z0-9_/.-] is refused rather than silently skipped.
There is no sandbox on Darwin yet: dprint is the unwrapped binary there. A macOS sandbox is a follow-up.
scripts/sandbox-conformance.sh proves the sandbox in CI, and nix flake check builds the probe that script runs.
See https://dprint.dev/plugins/
Repos:
- dprint-plugin-typescript - TypeScript/JavaScript code formatter.
- dprint-plugin-json - JSON/JSONC code formatter.
- dprint-plugin-markdown - Markdown code formatter.
- dprint-plugin-toml - TOML code formatter.
- dprint-plugin-jupyter - Jupyter notebook code block formatter.
- dprint-plugin-dockerfile - Dockerfile code formatter.
- dprint-plugin-sql - SQL code formatter (PostgreSQL, MySQL, SQL Server, SQLite, Oracle, BigQuery and Snowflake).
- dprint-plugin-prettier - Prettier wrapper plugin.
- dprint-plugin-biome - Biome (JS/TS/JSON) wrapper plugin.
- dprint-plugin-oxc - Oxc (JS/TS/JSON/CSS/SCSS/Less/GraphQL/YAML/TOML) wrapper plugin.
- dprint-plugin-bun - Bun (JS/TS/JSON/CSS/SCSS/Less/GraphQL/YAML/Markdown/HTML/Vue/Handlebars/TOML) wrapper plugin.
- dprint-plugin-tidy - tidy (HTML/Vue/Handlebars/CSS/SCSS/Less/JSON/YAML/TOML/XML/GraphQL/INI/Dockerfile/Markdown/JS/TS) wrapper plugin.
- dprint-plugin-roslyn - Roslyn (C#/VB) wrapper plugin.
- dprint-plugin-csharpier - CSharpier (C#/XML) wrapper plugin.
- dprint-plugin-mago - Mago (PHP) wrapper plugin.
- dprint-plugin-clang-format - clang-format (C/C++/Objective-C) wrapper plugin.
- dprint-plugin-cedar - cedar-policy-formatter (Cedar) wrapper plugin.
- dprint-plugin-typstyle - Typstyle (Typst) wrapper plugin.
- dprint-plugin-nix - nixfmt-rs (Nix) wrapper plugin.
- dprint-plugin-alejandra - Alejandra (Nix) wrapper plugin.
- dprint-plugin-kdl - kdl-rs (KDL) wrapper plugin.
- dprint-plugin-shuck - shuck-formatter (sh/Bash/Zsh) wrapper plugin.
- dprint-plugin-shfmt - shfmt (sh/Bash/Zsh) wrapper plugin.
- dprint-plugin-stylua - StyLua (Lua/Luau) wrapper plugin.
- dprint-plugin-zig - zig fmt (Zig) wrapper plugin.
- dprint-plugin-terraform - Terraform, OpenTofu and HCL formatter (tofu fmt and hclfmt).
- dprint-plugin-buildifier - buildifier (Bazel/Starlark) wrapper plugin.
- dprint-plugin-wat - wat_formatter (WebAssembly Text Format) wrapper plugin.
- dprint-plugin-ruff - Ruff (Python) wrapper plugin.
- dprint-plugin-exec - Formats code with any CLI executable.
- Malva - CSS, SCSS, Sass, and Less formatter
- markup_fmt - HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks, Vento, Mustache and XML formatter.
- pretty_graphql - GraphQL formatter.
- pretty_yaml - YAML formatter.
- dprint-plugin-gofumpt - Go (gofumpt) formatter.
- panache - Quarto, Pandoc, R Markdown, and Markdown formatter.
- badness - LaTeX and BibTeX formatter.
- arity - R formatter.
- fatou - Julia formatter.
- bibtex-tidy - BibTeX (bibtex-tidy) formatter.
- dprint-plugin-swift - Swift (SwiftFormat) formatter.
- lax-css - CSS, SCSS, and Less formatter.
- lax-markup - HTML, XML, SVG, Vue, Svelte, and Astro formatter.
- lax-sql - SQL formatter.
- cmakefmt - CMake formatter.
- cmakefmt (azais-corentin) - CMake formatter.
I do a lot of this development in my spare time. Please consider sponsoring if you are a commercial company using this.