.editorconfig for formatting rules that need repository style preferences. Use .editorconfig for shared whitespace and indentation
settings, and use .tally.toml for enabling, disabling, or changing the severity of lint rules.
This page will collect tally features that integrate with EditorConfig as they are added.
Recommended Dockerfile settings
Add this section to your repository’s.editorconfig to keep Dockerfiles and Containerfiles consistent:
Dockerfile, Dockerfile.*, Containerfile, and Containerfile.*.
Rules that use EditorConfig
tally/prefer-formatted-heredocsformatsCOPYandADDheredoc bodies for JSON, YAML, TOML, XML, and INI files, plus shell heredocs from executableRUNheredocs andCOPYheredocs with a shell shebang or.shdestination. PowerShell heredocs are formatted through PSScriptAnalyzer and do not use EditorConfig today.
services/api/Dockerfile targeting /etc/app/config.yaml is resolved as services/api/config.yaml, so
*.yaml and config.yaml sections apply.
COPY shell heredocs use that same destination-basename lookup. For example, a heredoc targeting /usr/local/bin/entrypoint.sh is resolved as
entrypoint.sh, so *.sh and entrypoint.sh sections apply.
For RUN shell heredocs, tally uses a virtual filename next to the Dockerfile named Dockerfile.heredoc.<dialect>, such as
Dockerfile.heredoc.sh, Dockerfile.heredoc.bash, or Dockerfile.heredoc.zsh.
Supported Properties
The heredoc formatter currently reads these EditorConfig properties:| Property | Behavior |
|---|---|
indent_style | Uses tabs when set to tab; otherwise uses spaces. |
indent_size | Sets the number of spaces per indent level when it is a positive integer. |
tab_width | Used as the fallback indent width when indent_size is not a positive integer. |
max_line_length | YAML and shell heredocs. For YAML, a positive integer is used as the preferred scalar wrapping width. For shell heredocs, a positive integer is used as the preferred command wrapping width; unset and invalid values use 100, and off disables the shell line-width pass. This is a formatting preference, not a hard maximum. |
binary_next_line | Shell heredocs only. Mirrors shfmt --binary-next-line. |
switch_case_indent | Shell heredocs only. Mirrors shfmt --case-indent. |
space_redirects | Shell heredocs only. Mirrors shfmt --space-redirects. |
keep_padding | Shell heredocs only. Mirrors shfmt --keep-padding. |
function_next_line | Shell heredocs only. Mirrors shfmt --func-next-line. |
simplify | Shell heredocs only. Mirrors shfmt --simplify. |
minify | Shell heredocs only. Mirrors shfmt --minify and implies simplify. |
| Property | Reason |
|---|---|
insert_final_newline | Heredoc bodies always need a newline before the terminator, so formatted payloads always end with exactly one newline regardless of this setting. |
end_of_line | Heredoc payloads are embedded in the Dockerfile and should follow the parent Dockerfile’s line-ending convention rather than a separate virtual target setting. |
charset | tally already reads Dockerfiles as text and does not transcode heredoc payloads during formatting. |
trim_trailing_whitespace | Formatted output for the currently supported structured formats does not emit incidental trailing whitespace. tally does not read this property or run a separate trimming pass, because whitespace may be payload data in some formats. |