Versions:
maxdop by Page Brooks is an opinionated formatter for T-SQL, the SQL dialect of Microsoft SQL Server, that is designed to run in CI and to check its own work. It uses ScriptDom, the parser from Microsoft that is also behind DacFx and SQL database projects, and therefore reads stored procedures, GO batches and syntax from the SQL Server 2000 era the way the server does rather than guessing from tokens. Every formatted result is parsed again and compared with the input in terms of token stream, syntax tree and comments. If any mismatch is found, the original file is returned untouched with a distinct exit code, so a bug in the formatter cannot corrupt source code. Measured across 2,215 real-world files, it refused nothing, crashed on nothing and lost none of their 11,261 comments. The tool is a single static binary that needs no .NET runtime, and the same binary runs in the editor and in the build pipeline. Style settings are stored in a .maxdop.json file committed next to the code, so a repository is formatted identically for everyone. maxdop belongs to the category of database developer tools and code formatters. The current release is version 0.1.4, and several versions are available in the catalog.
Tags: