Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/shfmt: document when --filename is needed for EditorConfig support
EditorConfig files are found based on a script's absolute path, and the EditorConfig patterns are usually filename-based as well. When formatting standard input, there is no known filename or path. Sometimes there's a need to format a stream of bytes in memory without having to place them on a file, which is why we support stdin. We added the --filename flag for this purpose a long time ago, and the tests already verified this fact - we just hadn't documented it. While here, also add a test case for absolute paths. Fixes #1055.
- Loading branch information