1 min read
pyssg.watch.ignore
Pure ignore-matching helper for the watcher.
The watcher must drop editor temp noise and anything matching the configured
ignore globs before emitting an :class:~pyssg.watch.events.FsEvent, so
the rebuild loop never sees output-dir churn or *.swp flicker (which would
otherwise risk a build->event->build loop). Matching is a small pure function so
it can be unit-tested in isolation; it never touches the filesystem.
is_ignored(path: str, ignore: list[str]) -> bool
Whether path should be ignored by the watcher.
Combines the always-on temp/VCS/output noise globs (:data:ALWAYS_IGNORE)
with the user-supplied ignore list. Matching is case-sensitive and
separator-agnostic.
Parameters
| Name | Type | Description |
|---|---|---|
path | A filesystem path (absolute or relative; any separator style). | |
ignore | Extra globs from config (``WatchOptions.ignore``), e.g. ``["*.tmp", "output/"]``. |
Returns
| Type | Description |
|---|---|
| ``True`` if any always-ignore or configured glob matches. |