Skip to content
systemfsoftwarePublic
forked from dprint/dprint

About

Pluggable and configurable code formatting platform that unifies all your formatters.

Resources

Code of conduct

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

dprint

npm crates.io Homebrew

Monorepo for dprint—a pluggable and configurable code formatting platform.

Links

Nix flake

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#dprint

Outputs:

  • dprint-unwrapped: the source build of the CLI.
  • dprint (and default): 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.

Plugins

See https://dprint.dev/plugins/

Repos:

Notes

I do a lot of this development in my spare time. Please consider sponsoring if you are a commercial company using this.

About

Pluggable and configurable code formatting platform that unifies all your formatters.

Resources

Code of conduct

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages