Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 25ab7ce

Browse files
authored
Merge pull request #135 from csalvato/csalvato-docs
Updates README with docs on globbing
2 parents f665731 + c172698 commit 25ab7ce

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
@@ -245,6 +245,16 @@ This should be a text file with each argument on a separate line.
245245

246246
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.
247247

248+
### Globbing
249+
250+
When running commands with `stree` in the CLI, the globs must follow the Ruby-specific globbing syntax as specified in the docs for [Dir](https://ruby-doc.org/core-2.6.3/Dir.html#method-c-glob). To ensure consistent file matching across environments (e.g. CI vs. local development) it's safest to enclose the glob in quotes.
251+
252+
For example, if you are in a Rails app and want to ignore the `db/schema.rb` file but check all other Ruby files and the `Gemfile`, you can use the following syntax:
253+
254+
```shell
255+
stree check '**/{[!schema]}*.rb' 'Gemfile'
256+
```
257+
248258
## Library
249259

250260
Syntax Tree can be used as a library to access the syntax tree underlying Ruby source code.

0 commit comments

Comments
 (0)