A configurable source code formatter for the D programming language that enforces consistent style.
dfmt is a source code formatter specifically designed for the D programming language. It automatically restructures D code to adhere to a consistent style based on configurable rules, solving the problem of inconsistent formatting across teams and projects. It reads from stdin or files and outputs formatted code, supporting both command-line use and integration into development workflows.
D language developers and teams who want to enforce a uniform coding style automatically, as well as open-source D project maintainers seeking to standardize contributions.
Developers choose dfmt because it is the standard, community-maintained formatter for D, offering deep integration with D's syntax, extensive configuration via EditorConfig, and the ability to disable formatting locally when needed.
Dfmt is a formatter for D source code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates with standard .editorconfig files for project-wide configuration, with dfmt-specific extensions, making it easy to adopt in existing workflows.
Offers over 20 configurable options for braces, indentation, spacing, and more, as detailed in the README, allowing precise enforcement of coding standards.
Supports // dfmt off and // dfmt on comments to temporarily exclude specific code blocks from formatting, useful for preserving intentional layouts like in getopt examples.
With the --inplace option, dfmt can directly modify files, facilitating seamless addition to build scripts or automated workflows for consistent formatting.
Explicitly labeled as beta quality in the README, requiring users to make backups or use source control, indicating potential bugs and instability in production use.
Some configuration properties, such as dfmt_outdent_attributes and dfmt_space_after_keywords, are marked as 'Not yet implemented', limiting current functionality.
Installation involves building from source with DUB or Make, and IDE integration requires manual setup, lacking pre-built plugins for many editors.