Commit 394f7847 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat(deprecated-warnings): display structured informations of warnings

parent 3731e67e71d2
Pipeline #18895 passed with stages
in 5 minutes and 8 seconds
...@@ -165,6 +165,9 @@ for key, value in all_artifacts.items(): ...@@ -165,6 +165,9 @@ for key, value in all_artifacts.items():
if not file_content: if not file_content:
warning_content[2] = warning["file_content"] warning_content[2] = warning["file_content"]
if warning["category"] != "DeprecationWarning" and "full_warning" not in result[warning_text]:
result[warning_text]["full_warning"] = warning
result[warning_text]["path"] = sorted(result[warning_text]["path"], key=lambda x: x[0]) result[warning_text]["path"] = sorted(result[warning_text]["path"], key=lambda x: x[0])
result = sorted(result.items(), key=lambda x: -x[1]["count"]) result = sorted(result.items(), key=lambda x: -x[1]["count"])
......
...@@ -13,7 +13,22 @@ ...@@ -13,7 +13,22 @@
{% for warning_name, warning_data in warnings %} {% for warning_name, warning_data in warnings %}
<h3>Warning: "{{ warning_name }}"</h4> <h3>Warning: "{{ warning_name }}"</h4>
Number of occurences: {{ warning_data["count"] }} <p>Number of occurences: {{ warning_data["count"] }}</p>
{% if "full_warning" in warning_data %}
<p>Structured data:</p>
<ul>
<li>kind: {{ warning_data["full_warning"]["kind"].split(".")[1].lower() }}</li>
<li>operation: {{ warning_data["full_warning"]["operation"].split(".")[1].lower() }}</li>
{% for key, value in warning_data["full_warning"].items() %}
{% if key not in ("kind", "path", "args", "category", "count", "file_content",
"filename", "lineno", "reason", "test_file", "test_lineno",
"test_name", "operation") %}
<li>{{ key }}: {{ value }}</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% for path, lineno, file_content in warning_data["path"] %} {% for path, lineno, file_content in warning_data["path"] %}
<h5>In {{ path }} line {{ lineno }}</h5> <h5>In {{ path }} line {{ lineno }}</h5>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment