forked from pre-commit/pre-commit.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhooks.mako
52 lines (46 loc) · 1.72 KB
/
hooks.mako
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
## -*- coding: utf-8 -*-
<%inherit file="base.mako" />
<div class="page-header"><h1>Supported hooks</h1></div>
<div class="row mb-4">
<div class="col">
<label for="search-hook-id" class="mb-2">Filter hook id:</label>
<input id="search-hook-id" type="text" placeholder="filter hook id" class="form-control form-control-sm"></input>
</div>
<div class="col">
<label for="search-hook-id" class="mb-2">Filter hook type:</label>
<select id="select-hook-type" class="form-select form-select-sm">
<option value="">--</option>
% for hook_type in sorted(all_types, key=str.lower):
<option value="${hook_type}">${hook_type}</option>
% endfor
</select>
</div>
</div>
<p>
To add to this list, fork <a href="https://github.com/pre-commit/pre-commit.com">this repository</a>.
</p>
<p>
Also available in <a href="/all-hooks.json">json</a>.
</p>
<div id="hooks">
% for repository, hooks in all_hooks.items():
<h3 data-repo="${repository}">
<a href="${repository}" target="_blank">
${repository.replace('https://', '')}
</a>
</h3>
<ul data-repo="${repository}">
% for hook_dict in hooks:
<li data-id="${hook_dict['id']}" data-types="${', '.join(hook_dict.get('types', []) + hook_dict.get('types_or', []))}">
<code>${hook_dict['id']}</code>
% if 'description' in hook_dict:
- ${hook_dict['description']}
% elif hook_dict['name'].lower() != hook_dict['id'].lower():
- ${hook_dict['name']}
% endif
</li>
% endfor
</ul>
% endfor
</div>
<script src="assets/filter_repos.js"></script>