Anton Shestakov <av6@dwimlabs.net>, Sun, 19 Jun 2016 14:07:11 +0800
incoming: skip checking the whole line when it's linter output
When a line starts with a certain pattern, it's recognized as linter output,
but determining if it's an error or a warning was done looking at the whole
string again multiple times. Let's save on regexes and look only on the
important part.
templates/ui/badges.html
Permissions: -rw-r--r--
{% if not check.success %} <span class="uk-badge uk-badge-unknown uk-text-large" title="checking failed">?
</span> {% elif check.errors or check.warnings %} <span class="uk-badge uk-badge-danger uk-text-large" title="{{ locale.translate('{} error', '{} errors', check.errors).format(check.errors) }}"> <span class="uk-badge uk-badge-warning uk-text-large" title="{{ locale.translate('{} warning', '{} warnings', check.warnings).format(check.warnings) }}"> <span class="uk-badge uk-badge-success uk-text-large" title="no lint found">OK
</span>