Skip to content
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

Support shared inverse regexes #36

Open
dradtke opened this issue Jan 4, 2017 · 3 comments
Open

Support shared inverse regexes #36

dradtke opened this issue Jan 4, 2017 · 3 comments

Comments

@dradtke
Copy link

dradtke commented Jan 4, 2017

I was running into a too many open files issue due to having a lot of stuff in my project's vendor/ folder, which was odd because my configuration specified --inverse-regex='^vendor/'. After some investigation, I realized that Reflex only excludes files from its watcher as long as it knows that all of the specified configurations should ignore that regex; if any of them don't include it explicitly, then Reflex will still walk the tree just in case something needs it. Since I use Reflex for several different purposes, I had to add --inverse-regex='^vendor/' to about 5 different lines before the issue went away, even though the rest of them include a more specific --regex that would never match a vendored file anyway.

A couple possible solutions are:

  1. Allow both a config file and command-line inverse regexes. If an inverse regex is provided as an argument, it should apply to all watchers found in the config.
  2. Update the config file syntax to support some form of reusable arguments, even if it's just environment variable expansion.
@SophisticaSean
Copy link

also got bit by this, im tempted to submit a pr for it. thanks for the workaround @dradtke

@awildeep
Copy link

There also does not appear to be an easy way to see how many files are being watched, and which files they are. It would be awesome to have a flag to have reflex log the watch list, as well as a way of knowing it's limits.

@SophisticaSean
Copy link

@awildeep if you use the verbose flag (-v) it outputs files as they change to stdout.

Example:

reflex -r '.go' -d fancy -v go build
Globals set at commandline
| --decoration (-d) 'fancy' (default: 'plain')
| --regex (-r) '[.go]' (default: '[]')
| --verbose (-v) 'true' (default: 'false')
+---------
Reflex from [commandline]
| ID: 0
| Inverted regex match: "(^|/)\\.git/"
| Inverted regex match: "(^|/)\\.hg/"
| Inverted regex match: "~$"
| Inverted regex match: "\\.swp$"
| Inverted regex match: "\\.#"
| Inverted regex match: "(^|/)#.*#$"
| Inverted regex match: "(^|/)\\.DS_Store$"
| Regex match: ".go"
| Substitution symbol {}
| Command: [go build]
+---------

[info] fsnotify event: "web.go": REMOVE
[info] fsnotify event: "web.go": CREATE
[info] fsnotify event: "web.go~": CREATE
[info] fsnotify event: "web.go": RENAME
[info] fsnotify event: "web.go": CREATE
[info] fsnotify event: "web.go": CHMOD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants