lukeed/tidyPublic

feat: format Dockerfiles

A port of dprint-plugin-dockerfile 0.7.0: its parser, its generator,
and the parts of dprint-core's printer that it uses. It prints what
dprint prints in one pass on the plugin's 167 specs and on 326 of 342
corpus files, under five option sets.

dprint's output often changes when formatted again (202 of 342 files),
and the later passes can break a file. tidy differs from dprint where
its first pass is read back differently, or changes what Docker reads:
a bare continuation line continues, empty lines after a continuation
are skipped, quoted ENV values stay as written, a value with a tab is
quoted, a keyword glued to its text stays as it is, comment indents
skip blank lines, and a stage's indent isn't read back as content.
tidy then doesn't change its own output on the corpus.

The oracle compares with dprint's first pass on specs, files and fuzz,
and checks that tidy's output is stable.
LELuke Edwards authored
37ce85bPatch
Parent65521d9
11 files changed+2748-1
StackedSplit
Cargo.toml+1 −1
crates/tidy/src/dockerfile/ast.rs+222 −0
crates/tidy/src/dockerfile/mod.rs+85 −0
crates/tidy/src/dockerfile/parse.rs+935 −0
crates/tidy/src/dockerfile/print.rs+896 −0
crates/tidy/src/lib.rs+1 −0
mise.toml+5 −0
notice.md+1 −0
tests/oracle/dockerfile/Cargo.lock+268 −0
tests/oracle/dockerfile/Cargo.toml+10 −0
tests/oracle/dockerfile/src/main.rs+324 −0