An extra newline was being added by the editor

pull/206/head
Josh Asplund 7 years ago
parent 45a8c47a10
commit 71e512a682
  1. 3
      .editorconfig
  2. 2
      mythril/analysis/report.py
  3. 26
      mythril/analysis/templates/report_as_markdown.jinja2
  4. 23
      mythril/analysis/templates/report_as_text.jinja2

@ -8,3 +8,6 @@ insert_final_newline = true
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
charset = utf-8 charset = utf-8
[*.jinja2]
insert_final_newline = false

@ -38,7 +38,7 @@ class Issue:
self.lineno = codeinfo.lineno self.lineno = codeinfo.lineno
class Report: class Report:
environment = Environment(loader=PackageLoader('mythril.analysis')) environment = Environment(loader=PackageLoader('mythril.analysis'), trim_blocks=True)
def __init__(self, verbose=False): def __init__(self, verbose=False):
self.issues = {} self.issues = {}

@ -1,7 +1,7 @@
# Analysis results for {{ filename }} # Analysis results for {{ filename }}
{% if issues %}
{%- if issues %}
{% for key, issue in issues.items() %} {% for key, issue in issues.items() %}
## {{ issue.title }} ## {{ issue.title }}
- Type: {{ issue.type }} - Type: {{ issue.type }}
@ -11,25 +11,27 @@
### Description ### Description
{{ issue.description }} {{ issue.description.rstrip() }}
{% if issue.filename and issue.lineno -%} {% if issue.filename and issue.lineno %}
In file: {{ issue.filename }}:{{ issue.lineno }} In file: {{ issue.filename }}:{{ issue.lineno }}
{%- endif -%} {% endif %}
{%- if issue.code %} {% if issue.code %}
### Code ### Code
``` ```
{{ issue.code }} {{ issue.code }}
``` ```
{%- endif %} {% endif %}
{%- if verbose and issue.debug -%} {% if verbose and issue.debug %}
-------------------- --------------------
### Debugging Information: ### Debugging Information:
{{ issue.debug }} {{ issue.debug }}
{%- endif %}
{% endfor -%} {% endif %}
{%- else -%} {% endfor %}
{% else %}
The analysis was completed successfully. No issues were detected. The analysis was completed successfully. No issues were detected.
{%- endif -%} {% endif %}

@ -1,5 +1,5 @@
{%- if issues -%} {% if issues %}
{% for key, issue in issues.items() -%} {% for key, issue in issues.items() %}
==== {{ issue.title }} ==== ==== {{ issue.title }} ====
Type: {{ issue.type }} Type: {{ issue.type }}
Contract: {{ issue.contract | default("Unknown") }} Contract: {{ issue.contract | default("Unknown") }}
@ -7,22 +7,23 @@ Function name: {{ issue.function }}
PC address: {{ issue.address }} PC address: {{ issue.address }}
{{ issue.description }} {{ issue.description }}
-------------------- --------------------
{% if issue.filename and issue.lineno -%} {% if issue.filename and issue.lineno %}
In file: {{ issue.filename }}:{{ issue.lineno }} In file: {{ issue.filename }}:{{ issue.lineno }}
{%- endif %} {% endif %}
{%- if issue.code %} {% if issue.code %}
{{ issue.code }} {{ issue.code }}
-------------------- --------------------
{% endif -%} {% endif %}
{% if verbose and issue.debug -%} {% if verbose and issue.debug %}
-------------------- --------------------
DEBUGGING INFORMATION: DEBUGGING INFORMATION:
{{ issue.debug }} {{ issue.debug }}
{%- endif %} {% endif %}
{% endfor -%}
{%- else -%} {% endfor %}
{% else %}
The analysis was completed successfully. No issues were detected. The analysis was completed successfully. No issues were detected.
{%- endif -%} {% endif %}
Loading…
Cancel
Save