Skip to content

Commit

Permalink
Address some feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg committed Sep 6, 2024
1 parent 43bff99 commit 5742299
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions dco2/templates/how_to_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{%~ if commits|contains_error([CommitError::SignOffNotFound, CommitError::SignOffMismatch]) +%}
## How to fix missing or invalid sign-offs

{%~ include "remediation.md" +%}

{%~ include "signoff.md" +%}
{% endif %}
10 changes: 2 additions & 8 deletions dco2/templates/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@

{%~ include "summary.md" +%}

{%~ include "details.md" +%}
{%~ include "errors_details.md" +%}

{%~ if commits|contains_error([CommitError::SignOffNotFound, CommitError::SignOffMismatch]) +%}
{{~ "## How to fix missing or invalid sign-offs" +}}

{%~ include "remediation.md" +%}

{%~ include "signoff.md" +%}
{% endif %}
{%~ include "how_to_fix.md" +%}

{% endif %}

Expand Down
5 changes: 3 additions & 2 deletions dco2/templates/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
{%+ for entry in commits %}
{% let (sha_truncated, rest) = entry.commit.sha.split_at(8) %}
{% let message = entry.commit.message.split_once('\n') %}
{% let subject = entry.commit.message.lines().next().unwrap_or_default() %}
{% if entry.errors.is_empty() %}
| :green_circle: | [{{ sha_truncated }}]({{ entry.commit.html_url }}) | {% if let Some((subject, rest)) = message %}{{ subject|truncate(50) }}{% else %}{{ entry.commit.message|truncate(50) }}{% endif %} | {% if let Some(success_reason) = entry.success_reason %}`{{ success_reason|capitalize }}`{% endif %} |
| :green_circle: | [{{ sha_truncated }}]({{ entry.commit.html_url }}) | {{ subject|truncate(50) }} | {% if let Some(success_reason) = entry.success_reason %}`{{ success_reason|capitalize }}`{% endif %} |
{% else %}
| :red_circle: | [{{ sha_truncated }}]({{ entry.commit.html_url }}) | {% if let Some((subject, rest)) = message %}{{ subject|truncate(50) }}{% else %}{{ entry.commit.message|truncate(50) }}{% endif %} |{% for error in entry.errors %}{% if !loop.first %}{{ " " +}}{% endif %}`{{ error|capitalize }}`{% endfor %} |
| :red_circle: | [{{ sha_truncated }}]({{ entry.commit.html_url }}) | {{ subject|truncate(50) }} |{% for error in entry.errors %}{% if !loop.first %}{{ " " +}}{% endif %}`{{ error|capitalize }}`{% endfor %} |
{% endif +%}
{%+ endfor +%}

0 comments on commit 5742299

Please sign in to comment.