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

watchman-make should support ignoring some patterns #769

Open
anarcat opened this issue Dec 10, 2019 · 0 comments
Open

watchman-make should support ignoring some patterns #769

anarcat opened this issue Dec 10, 2019 · 0 comments

Comments

@anarcat
Copy link

@anarcat anarcat commented Dec 10, 2019

Here I am trying to use watchman-make to run tests on file changes:

watchman-make --root feed2exec/ -p '**/*.py' --run tox

My project is called feed2exec and I used the --root argument to keep changes to .tox and egg files from being picked up, otherwise it would constantly rerun because tox would trigger itself...

... except it still triggers itself because tox touches the feed2exec/_version.py file on build. I can't figure out a way to use watchman in this use case...

I did manage to use watchman this way:

$ watchman watch feed2exec/
{
    "version": "4.9.0",
    "watch": "/home/anarcat/src/feed2exec/feed2exec",
    "watcher": "inotify"
}
$ watchman -j <<EOF
["trigger", "feed2exec", {
"name": "test",
"expression": ["pcre", "^[^_].*\\.(py)$"],
"command": ["tox", "--", "-v"], 
"append_files": false
}]
EOF
{
    "version": "4.9.0",
    "triggerid": "test",
    "disposition": "created"
}

But that's really kind of nasty, and it doesn't show the actual output of the commands. I need to tail this arbitrary file in /tmp/anarcat-state/log to get any idea of what's going on. And worse, all the colors are gone from there...

So it would be great (and so much simpler) to have watchman-make support more complicated patterns... It looks like the patterns_to_terms function is where the action happens.

Note that I noticed that I could make that file "hidden" (prepend path name with a dot), but those files are notoriously hard to import in Python, so I'd rather avoid that.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.