pyssg is pre-1.0 and under active development - APIs, config, and themes may change.
pyssg.watch.ignore

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

NameTypeDescription
pathA filesystem path (absolute or relative; any separator style).
ignoreExtra globs from config (``WatchOptions.ignore``), e.g. ``["*.tmp", "output/"]``.

Returns

TypeDescription
``True`` if any always-ignore or configured glob matches.