schell / steeloverseer

A file watcher and development tool.
BSD 3-Clause "New" or "Revised" License
128 stars 15 forks source link

Exclusion patterns #25

Closed schell closed 7 years ago

schell commented 7 years ago

It would be great to be able to exclude patterns explicitly so we don't have to model that with regular expressions. Excluding based on a string makes for a pretty tough regex.

sos -p ".*\.l?hs$" -e "#" -e "flycheck" -c "stack build"

This sos command would only stack build when changes are made to a haskell file (possibly literate haskell) that doesn't contain a # or flymake, which are both emacs artifacts.

mitchellwrosen commented 7 years ago

So flymake generates a file alongside the original, not tucked away in some special directory? As in,

- src/
  - src/Foo.hs
  - src/Foo_flymake.hs

or something?

schell commented 7 years ago

Yes - here's a play by play excerpt while working on varying (editing Event.hs without saving, btw):

schell~/D/c/varying:master$ sos -p ".*" -c "echo blah"
Hit Ctrl+C to quit.

Added: src/Control/Varying/.#Event.hs
[1/1] echo blah
blah
Success ✓

Added: src/Control/Varying/flycheck_Event.hs
[1/1] echo blah
blah
Success ✓

Added: src/Control/Varying/flycheck_Event.hs
[1/1] echo blah
blah
Success ✓

Added: src/Control/Varying/flycheck_Event.hs
[1/1] echo blah
blah
Success ✓
mitchellwrosen commented 7 years ago

Ok, just making sure this problem can't be solved by just picking a dir other than . to watch :)

Should be simple to add

schell commented 7 years ago

Totally - checking for # is pretty easy with character classes, but the flycheck string is trickier and really gunks up the watch regex.

schell commented 7 years ago

Works like a charm! Thanks @mitchellwrosen.