comect.sidecar.filters.base module

class comect.sidecar.filters.base.Filter

Bases: abc.ABC

Filters decide whether a line should be processed by the current pipeline or not.

Subclass this class and provide an instance in your pipeline, or use a function if that suits your project better.

If you’re subclassing, then you must implement __call__().

abstract __call__(line, path)

Check whether a line should be processed.

Parameters
  • line (Union[str, bytes]) – The line to be checked

  • path (Path) – The path to the file the line is from

Return type

bool

Returns

True if the line should be processed, False otherwise