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
@@ -231,6 +232,19 @@ To change the print width that you are writing with, specify the `--print-width`
231
232
stree write --print-width=100 path/to/file.rb
232
233
```
233
234
235
+
### Configuration
236
+
237
+
Any of the above CLI commands can also read configuration options from a `.streerc` file in the directory where the commands are executed.
238
+
239
+
This should be a text file with each argument on a separate line.
240
+
241
+
```txt
242
+
--print-width=100
243
+
--plugins=plugin/trailing_comma
244
+
```
245
+
246
+
If this file is present, it will _always_ be used for CLI commands. You can also pass options from the command line as in the examples above. The options in the `.streerc` file are passed to the CLI first, then the arguments from the command line. In the case of exclusive options (e.g. `--print-width`), this means that the command line options override what's in the config file. In the case of options that can take multiple inputs (e.g. `--plugins`), the effect is additive. That is, the plugins passed from the command line will be loaded _in addition to_ the plugins in the config file.
247
+
234
248
## Library
235
249
236
250
Syntax Tree can be used as a library to access the syntax tree underlying Ruby source code.
0 commit comments