You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/en/guide/cli/fmt.mdx
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,18 @@ Without this option, `rs fmt` stores cache data in `.rstack/cache/fmt` under the
133
133
134
134
See [Cache](../formatting#cache) for cache behavior and cleanup guidance.
135
135
136
+
### `--cache-location <path>`
137
+
138
+
Store the persistent cache in a custom directory:
139
+
140
+
```bash
141
+
rs fmt --cache-location .cache/rs-fmt
142
+
```
143
+
144
+
Relative paths are resolved from the current working directory, while absolute paths are used as-is. The directory is created as needed and excluded from file discovery. Unlike the default cache location, a custom directory does not receive an automatic `.gitignore`; exclude it from version control or manage it through your CI cache configuration.
145
+
146
+
When both options are provided, `--no-cache` takes precedence and the custom directory is not excluded from file discovery.
147
+
136
148
### `--no-error-on-unmatched-pattern`
137
149
138
150
Exit successfully without diagnostics when no files match the provided paths or globs, including when all matching files are ignored:
Copy file name to clipboardExpand all lines: website/docs/en/guide/formatting.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,6 +180,8 @@ define.fmt({
180
180
181
181
The default cache directory is `.rstack/cache/fmt` under the Rstack configuration root. When a command runs from a subdirectory, it continues to use the cache next to the resolved `rstack.config.*` file. Stdin formatting does not use this cache.
182
182
183
+
Use [`--cache-location <path>`](./cli/fmt#--cache-location-path) to store the cache in a different directory. Relative paths are resolved from the current working directory. Custom directories are excluded from file discovery but are not automatically ignored by Git.
184
+
183
185
Use [`--no-cache`](./cli/fmt#--no-cache) to run without reading, creating, or updating the cache:
0 commit comments