FilePath

Condition matching the current event’s file path against glob patterns.

Usage

Source

FilePath()

Accepts one or more glob patterns as positional arguments.

Example

hook(Event.PostToolUse, only_if=[FilePath(“.py”, ”.pyi”)], message=“Python file edited”)