Commit Graph

14 Commits

Author SHA1 Message Date
Félix Saparelli 446a8d95a7 Replace event queue with a priority queue (#302)
Solves several issues, generally through delivering signals before filesystem events, preventing situations where an overwhelming amount of events makes it impossible to quit.

Does _not_ solve the problem of a queue full of lower-priority events not accepting an urgent message, but that's a rarer issue that's more complicated to overcome.

Changes the Filterer trait: adds Priority to `check_event()`

Makes some events unfilterable (Urgent priority): SIGINT, SIGTERM, and CTRL_C to the main process. These still need to be handled by `on_action` to do anything, but cannot be stopped before reaching that.
2022-06-11 06:43:11 +00:00
Félix Saparelli e215e2c09f Add folder/file ignore and filter tests to globset (#299) 2022-06-07 11:25:50 +00:00
Félix Saparelli 72100217e8 Allow */foo filters to match foo (compat)
This is buggy behaviour that exists in <=1.17, and this patch restores it*

Per gitignore rules, this glob:

    */somefile

Will match:

    foo/somefile
    bar/somefile

But not:

    somefile

However, so far we’ve accepted this. As this is a breaking change, this patch
introduces a hack which lets us accept this behaviour, but clearly marks it as
a compatibility exception. In 2.0, this will be gone.

Fixes #258

* It only restores it on unices, because the behaviour cannot be restored in
  any reasonable manner on Windows. Ah well. It's not for long anyway.
2022-03-07 20:33:29 +13:00
Félix Saparelli 4af6865ef0 Add broken tests for regressions
See #258 and #259
2022-02-12 22:39:40 +13:00
Félix Saparelli b8ffa0c38a Formatting 2022-01-29 02:08:34 +13:00
Félix Saparelli a6c997f470
globset: Always pass non-path events (#248) 2022-01-26 09:59:53 +13:00
Félix Saparelli 59d8388d7e globset: allow multipath events through if any path passes the filter 2022-01-26 01:51:48 +13:00
Félix Saparelli 42d64d0a6d
Fail all folders on extension check 2022-01-26 01:18:32 +13:00
Félix Saparelli b8d9ad728e
Integrate IgnoreFilterer into GlobsetFilterer 2022-01-16 15:18:15 +13:00
Félix Saparelli 1af3a1c849
Extract common test helpers 2021-12-15 06:33:55 +13:00
Félix Saparelli f3bc5fa6d3
Test globset properly
All paths are canonicalised at entrance, so testing should reflect that
2021-11-30 01:42:00 +13:00
Félix Saparelli 0efdf8ea16
Pull globset tests from v1 2021-11-22 22:22:39 +13:00
Félix Saparelli c758675728
Prep for folder tests 2021-10-20 00:47:22 +13:00
Félix Saparelli 110e1d4c96
Start a test harness for globset 2021-10-17 17:11:50 +13:00