Skip to content

Commit

Permalink
FIX: Curlylint
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Oct 28, 2023
1 parent bc489e6 commit 4422ac3
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ repos:
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yml]

# curlylint
- repo: https://github.com/thibaudcolas/curlylint
rev: v0.13.1
hooks:
- id: curlylint
files: \.jinja$
args: ["--quiet"]
8 changes: 8 additions & 0 deletions mne/html_templates/report/footer.html.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{# Complete tags for curlylint #}
{{ if 0 }}
<html lang="{{ lang | safe }}">
<body>
<div>
<div>
{{ endif }}

</div>
</div>
<footer>
Expand Down
5 changes: 5 additions & 0 deletions mne/html_templates/report/header.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@
</div>
</div>
</nav>
{# Complete tags for curlylint #}
{{ if 0 }}
</body>
</html>
{{ endif }}
6 changes: 6 additions & 0 deletions mne/html_templates/report/toc.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@
</nav>
</div>
<div id="content" class="accordion col-10 offset-2">
{# Complete tags for curlylint #}
{{ if 0 }}
</div>
</div>
</div>
{{ endif }}
1 change: 1 addition & 0 deletions mne/html_templates/repr/evoked.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<th>Timepoints</th>
<td>{{ evoked.data.shape[1] }} samples</td>
</tr>
<tr>
<th>Channels</th>
<td>{{ evoked.data.shape[0] }} channels</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion mne/html_templates/repr/info.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</table>
</details>
<details{{ "" if collapsed else " open" }}>
<summary><strong>{{sections[1]}}<strong></summary>
<summary><strong>{{sections[1]}}</strong></summary>
<table class="table table-hover table-striped table-sm table-responsive small">
<tr>
<th>Digitized points</th>
Expand Down
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,16 @@ exclude = "(dist/)|(build/)|(.*\\.ipynb)"

[tool.bandit.assert_used]
skips = ["*/test_*.py"] # assert statements are good practice with pytest

[tool.curlylint]
include = '\.jinja$'

[tool.curlylint.rules]
aria_role = true
django_forms_rendering = true
html_has_lang = true
image_alt = true
# indent = 4
meta_viewport = true
no_autofocus = true
tabindex_no_positive = true

0 comments on commit 4422ac3

Please sign in to comment.