Skip to content

Commit 7125449

Browse files
Document --stdin-filepath in README.md (#954)
* Document --stdin-filepath in README.md. Fixes #953 * Update README.md --------- Co-authored-by: JohnnyMorganz <[email protected]>
1 parent 3d4b424 commit 7125449

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ Note that these integrations require the StyLua binary to already be installed a
114114

115115
- Sublime: [Sublime Text Package](https://github.com/aerobounce/Sublime-Pretty-Lua)
116116
- Neovim: [stylua-nvim](https://github.com/ckipp01/stylua-nvim) / [stylua.nvim](https://github.com/wesleimp/stylua.nvim)
117+
- Zed: [Zed Lua StyLua formatter settings](https://zed.dev/docs/languages/lua#stylua)
117118

118119
## Usage
119120

@@ -154,6 +155,15 @@ vendor/
154155

155156
running `stylua .` will ignore the `vendor/` directory.
156157

158+
### Filtering when using stdin
159+
160+
If you are formatting stdin by specifying `-` as the filename (usually as part of an editor integration)
161+
you can optionally provide the filename via `--stdin-filepath`. To respect glob or `.styluaignore` filtering, pass `--respect-ignores`.
162+
163+
```stylua
164+
stylua --respect-ignores --stdin-filepath src/foo.lua -
165+
```
166+
157167
### `--check`: Checking files for formatting
158168

159169
To check whether files require formatting (but not write directly to them), use the `--check` flag.

0 commit comments

Comments
 (0)