From 4f0dde8e96bf504887cfa4cc6b3c1df85364a329 Mon Sep 17 00:00:00 2001
From: jwansek <eddie.atten.ea29@gmail.com>
Date: Fri, 21 Jan 2022 20:00:38 +0000
Subject: did some more work on rendering txt reports

---
 templates/txt.jinja2 | 47 +++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 43 insertions(+), 4 deletions(-)

(limited to 'templates/txt.jinja2')

diff --git a/templates/txt.jinja2 b/templates/txt.jinja2
index 1daf52a..d6a0c16 100644
--- a/templates/txt.jinja2
+++ b/templates/txt.jinja2
@@ -18,12 +18,51 @@
     {%- endif -%}
     {% if "functions" in files_contents.keys() %}
         Functions:
-        {%- set flat_functions = flatten_struct(files_contents["functions"]) -%}
-        {% for function_name, function_contents in flat_functions.items() %}
-            {{ function_name }}
+        {%- set flat_functions = flatten_struct(files_contents["functions"]) %}
+        {%- for function_name, function_contents in flat_functions.items() %}
+            {{ function_name + ":" }}
+            {%- if function_contents["present"] %}
+                Arguments:
+                    {{ function_contents["arguments"] }}
+                    Enough? {{ bool_to_yesno(function_contents["minimum_arguments"] >= get_required_num_args(function_name)) }}
+                Documentation:
+                    {{ len_documentation(function_contents["documentation"]["comments"], function_contents["documentation"]["doc"]) }} characters long
+                    {%- if txt_show_full_docs == "True" %}
+                    Comments:
+                        {%- if function_contents["documentation"]["comments"] == "None" %}
+                        *** No comments present ***
+                        {%- else %}
+```
+{{ function_contents["documentation"]["comments"] }}
+```
+                        {%- endif %}
+                    Docstring:
+                        {%- if function_contents["documentation"]["doc"] == "None" %}
+                        *** No docstring present ***
+                        {%- else %}
+```
+{{ function_contents["documentation"]["doc"] }}
+```
+                        {%- endif -%}
+                    {%- endif %}
+                    Source:
+                        {{ get_source_numlines(function_contents["source_code"]) }}
+                        {%- if txt_show_source == "True" %}
+                        Code:
+```
+{{ function_contents["source_code"] }}
+```
+                        {%- endif %}
+            {%- else %}
+                *** Function not present ***
+            {%- endif %}
         {%- endfor -%}
     {%- endif -%}
     {% else %}
         *** File not present ***
     {% endif %}
-{% endfor %}
\ No newline at end of file
+{% endfor %}
+
+{% if out != "stdout" -%}
+{{ test_results["pytest_report"] }}
+{%- endif -%}
\ No newline at end of file
-- 
cgit v1.2.3