Pretty-printsDocumentation Index
Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
Use this file to discover all available pages before exploring further.
COPY and ADD heredoc bodies when the destination filename has a supported structured-data extension.
| Property | Value |
|---|---|
| Severity | Style |
| Category | Style |
| Default | Enabled |
| Auto-fix | Yes (safe) |
Description
This rule formats heredoc payloads that are copied into JSON, YAML, TOML, XML, or INI files. It detects the file type from the heredoc destination path extension and uses the repository’s.editorconfig settings for indentation. YAML heredocs can also use max_line_length as a preferred scalar
wrapping width.
For EditorConfig lookup, tally resolves a virtual filename next to the Dockerfile using the destination basename. For example, a heredoc in
services/api/Dockerfile targeting /etc/app/config.yaml is matched as services/api/config.yaml, so selectors such as *.yaml and config.yaml
apply naturally.
The formatter also runs as a final auto-fix pass. This means heredocs emitted by other rules, such as tally/prefer-copy-heredoc, are formatted in
the same --fix run when this rule is enabled.
Examples
Bad
Good
Supported Types
| Extension | Format |
|---|---|
.json | JSON |
.yaml, .yml | YAML |
.toml | TOML |
.xml, .config, .xsd, .wsdl, .xsl, .xslt | XML |
.ini | INI |
Configuration
Default (no config needed):.editorconfig for indentation style and width, and for YAML scalar wrapping width.
See EditorConfig integration for recommended Dockerfile settings and path resolution details.
The rule reads indent_style, indent_size, tab_width, and YAML-only max_line_length. max_line_length is treated as a preferred wrapping
width, not a hard maximum. It does not currently interpret insert_final_newline, end_of_line, charset, or trim_trailing_whitespace for the
virtual payload file. Formatted heredoc bodies always end with exactly one newline before the heredoc terminator, and line endings follow the parent
Dockerfile/fix application rather than a separate payload setting. The current structured serializers do not emit incidental trailing whitespace, but
tally does not run a separate trailing-whitespace trim pass because whitespace can be payload data.