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

Updates README with docs on globbing #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ This should be a text file with each argument on a separate line.

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.

### Globbing

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.

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:

```shell
stree check '**/{[!schema]}*.rb' 'Gemfile'
```

## Library

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