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_size = 4
charset = utf-8
[*.jinja2]
insert_final_newline = false

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

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

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