commit: 1d281c78d02de7a55fc918aa414d7e9620d8e101
Author: Michał Górny gentoo org>
AuthorDate: Sun Dec 17 16:59:49 2017 +
Commit: Michał Górny gentoo org>
CommitDate: Sun Dec 17 16:59:49 2017 +
URL:https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=1d281c78
pkgcheck2html: Group results by class
htdocs/pkgcheck2html.css| 8
pkgcheck2html/output.html.jinja | 21 +++--
pkgcheck2html/pkgcheck2html.py | 14 +-
3 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/htdocs/pkgcheck2html.css b/htdocs/pkgcheck2html.css
index eb17b19..44862ce 100644
--- a/htdocs/pkgcheck2html.css
+++ b/htdocs/pkgcheck2html.css
@@ -171,6 +171,14 @@ tr.warn td:hover
text-overflow: ellipsis;
}
+li.heading
+{
+ font-size: 125%;
+ color: white;
+ background-color: #463C65;
+ padding-left: .75em;
+}
+
.warn a
{
color: orange;
diff --git a/pkgcheck2html/output.html.jinja b/pkgcheck2html/output.html.jinja
index f8d6bf5..80c5167 100644
--- a/pkgcheck2html/output.html.jinja
+++ b/pkgcheck2html/output.html.jinja
@@ -14,14 +14,23 @@
issues
- {% for g in errors %}
- {{ g|join('/') }}
+ {% for g, pkgs in errors %}
+ {{ g
}}
+ {% for pkg in pkgs %}
+ {{ g|join('/') }}
+ {% endfor %}
{% endfor %}
- {% for g in warnings %}
- {{ g|join('/') }}
+ {% for g, pkgs in warnings %}
+ {{ g
}}
+ {% for pkg in pkgs %}
+ {{ g|join('/') }}
+ {% endfor %}
{% endfor %}
- {% for g in staging %}
- {{ g|join('/') }}
+ {% for g, pkgs in staging %}
+ {{
g }}
+ {% for pkg in pkgs %}
+ {{ pkg|join('/') }}
+ {% endfor %}
{% endfor %}
diff --git a/pkgcheck2html/pkgcheck2html.py b/pkgcheck2html/pkgcheck2html.py
index da5dee5..ffdf76a 100755
--- a/pkgcheck2html/pkgcheck2html.py
+++ b/pkgcheck2html/pkgcheck2html.py
@@ -4,6 +4,7 @@
# 2-clause BSD license
import argparse
+import collections
import datetime
import io
import json
@@ -77,11 +78,14 @@ def deep_group(it, level = 1):
def find_of_class(it, cls, level = 2):
+out = collections.defaultdict(set)
+
for g, r in group_results(it, level):
for x in r:
if x.css_class == cls:
-yield g
-break
+out[getattr(x, 'class')].add(g)
+
+return [(k, sorted(v)) for k, v in sorted(out.items())]
def get_result_timestamp(paths):
@@ -125,9 +129,9 @@ def main(*args):
out = t.render(
results = deep_group(results),
-warnings = list(find_of_class(results, 'warn')),
-staging = list(find_of_class(results, 'staging')),
-errors = list(find_of_class(results, 'err')),
+warnings = find_of_class(results, 'warn'),
+staging = find_of_class(results, 'staging'),
+errors = find_of_class(results, 'err'),
ts = ts,
)