Commit Graph

29 Commits

Author SHA1 Message Date
Félix Saparelli b842c149b6
Use Rust 2018 2019-10-27 23:58:00 +13:00
Félix Saparelli f56e838fb9
Lints and clippys 2019-10-27 23:47:35 +13:00
Ryan James Spencer e90bbcb9bd Support a dedicated ignore file
ref. https://github.com/passcod/cargo-watch/issues/127

This adds support for a dedicated ignore file by the name of `.ignore` a
la `fd`, `ripgrep`, et. al.

This purely just mimics what `Gitignore` is doing except it doesn't
ignore `.git` directories. There might be more I need to tweak and the
interface might be too obtuse, but this is a first pass.

I've also added a `--no-ignore` flag which ignores both `.gitignore` and
the dedicated `.ignore`. It might make sense to add a specific flag that
ignores `.ignore` but respects `.gitignore` to support the old
behaviour, but I wasn't sure what to name it.
2019-10-12 14:13:57 +13:00
Félix Saparelli 6f473bcd87 [meta] Run formatter 2019-01-26 15:15:27 +13:00
Félix Saparelli aae5a216b0 [api] Make watchexec take a Handler rather than a callback
Instead of special-casing the callback, which is the path least-taken,
switch the internals to a Handler model, where the default behaviour is
an implementation of a Handler, and external callers can implement their
own Handlers and pass them in.

While doing so, change all unwraps in run::run to returning Errs, and
expand the watchexec Error enum to accommodate. That should make it
easier to use as a library.

Also, differentiate between "manual" and "on update" runs. For now the
only manual run is the initial run, but this paves the way for e.g.
keyboard- or signal- triggered runs.
2019-01-26 14:45:13 +13:00
Félix Saparelli 2c5c145042 Extract errors into one thing and return a result more often 2018-09-08 23:51:44 +12:00
Félix Saparelli a6163cc599 Formatting 2018-09-08 20:08:36 +12:00
Matt Green 8770ae3967 Handle relative ignores better? 2017-10-07 15:50:47 -04:00
Chris Aumann 56ddfcbaee Apply rustfmt-0.8.1 2017-04-02 21:21:30 +02:00
Matt Green e16a6b3a24 Support watching multiple paths 2017-02-04 16:18:02 -05:00
Matt Green 53c1f39919 Load + handle multiple .gitignore files in project dir 2017-02-04 14:53:27 -05:00
Matt Green ebcb5976ba Use globset for ignore matching; closes #14 and #23 2017-01-27 13:00:13 -05:00
Matt Green 06bcef5853 Use globset in NotificationFilter; closes #24 2016-11-03 17:04:39 -04:00
Matt Green 82713fc906 Fix watching multiple dirs with differing roots 2016-10-29 10:24:31 -04:00
Matt Green a182fda43f Add NotificationFilter tests 2016-10-29 09:37:50 -04:00
Matt Green 672fd469a9 Reorder new() 2016-10-28 08:46:35 -04:00
Matt Green 4370d41e71 Make NotificationFilter immutable 2016-10-27 08:27:16 -04:00
Matt Green 1cc4d92345 PollWatcher sometimes reports directories with new/deleted files 2016-10-26 11:02:04 -04:00
Matt Green d10b790c35 Use rustfmt to fix outstanding style issues 2016-10-23 20:12:48 -04:00
Matt Green 6a812d31b4 Extract CLI arg handling to args module 2016-10-23 20:07:48 -04:00
Atmajeet Kaur f7c628c7e1 some clippy-suggested improvements 2016-10-18 15:39:40 +02:00
Matt Green 536613852f Enhance debug output; rename option back to debug 2016-10-13 20:21:29 -04:00
Matt Green b6831c4d30 Cleanups/more logging 2016-10-13 19:47:04 -04:00
Matt Green 9836882e71 Refine gitignore module 2016-10-12 09:06:01 -04:00
Matt Green f20d02a7f8 Support for gitignore files 2016-10-11 22:43:53 -04:00
Matt Green c990c9c4d4 Canonicalize watched paths 2016-09-27 09:43:28 -04:00
Matt Green 6072b353b9 Remove unnecessary clone 2016-09-23 14:04:19 -06:00
Matt Green b08880d4e4 Return unit from add_* fns 2016-09-23 14:00:26 -06:00
Matt Green 0892da59e2 Rename Filter to NotificationFilter 2016-09-23 13:52:50 -06:00