How to use the fontbakery.checkrunner.Status function in fontbakery

To help you get started, we’ve selected a few fontbakery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlefonts / fontbakery / Lib / fontbakery / reporters / ghmarkdown.py View on Github external
def omit_loglevel(self, msg):
    return self.loglevels and (self.loglevels[0] > Status(msg))
github googlefonts / fontbakery / Lib / fontbakery / reporters / html.py View on Github external
def omit_loglevel(self, msg) -> bool:
        """Determine if message is below log level."""
        return self.loglevels and (
            self.loglevels[0] > fontbakery.checkrunner.Status(msg)
        )
github googlefonts / fontbakery / Lib / fontbakery / reporters / terminal.py View on Github external
def __init__(self, collect_results_by=None
                   , check_threshold=None
                   , log_threshold=None
                   , **kwd):
    super(TerminalReporter, self).__init__(**kwd)
    self.results_by = collect_results_by
    self._collected_results = {}
    self._event_buffers = {}

    # logs can occur at any point in the logging protocol
    # especially DEBUG, INFO, WARNING and ERROR
    # FAIL, PASS and SKIP are only expected within checks though
    # Log statuses have weights >= 0
    log_threshold = log_threshold if type(log_threshold) is not Status \
                                  else log_threshold.weight
    self._log_threshold = min(ERROR.weight + 1 , max(0, log_threshold))

    # Use this to silence the output checks in async mode, it also activates
    # async mode if turned off.
    # You can't silence whole checks in sync output, as the events are
    # rendered as soon as they happen, you can however silence some log
    # messages in sync mode, use log_threshold for this.
    # default: no DEBUG output
    check_threshold = check_threshold if type(check_threshold) is not Status \
                                    else check_threshold.weight
    self._check_threshold = min(ERROR.weight + 1, max(PASS.weight, check_threshold))

    # if this is used we must use async rendering, otherwise we can't
    # suppress the output of checks, because we only know the final
    # status after ENDCHECK.