Skip to content

Commit 23578ae

Browse files
committed
Reorganize build, add hooks page.
1 parent 93b58b6 commit 23578ae

10 files changed

Lines changed: 430 additions & 395 deletions

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
*.html
12
*.iml
3+
*.swp
4+
.DS_Store
25
.idea
36
.project
47
.pydevproject
5-
py_env
6-
node_env
7-
*.swp
8+
all-hooks.json
89
bower_components
9-
.DS_Store
1010
build
11+
install-local.py
12+
node_env
13+
py_env

Makefile

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
11
# To build scss continuously I use `watch -n 0.1 make build/main.css`
22

3-
all: install_pre_commit build/main.css
3+
all: install_pre_commit build/main.css all-hooks.json index.html hooks.html install-local.py
44

5+
.PHONY: install_pre_commit
56
install_pre_commit: py_env
6-
bash -c 'source py_env/bin/activate && \
7-
pre-commit install'
7+
sh -c '. py_env/bin/activate && pre-commit install'
88

99
build/main.css: node_env build scss/main.scss scss/_variables.scss
10-
bash -c 'source py_env/bin/activate && \
11-
pyscss -o build/main.css scss/main.scss'
10+
sh -c '. py_env/bin/activate && pyscss -o build/main.css scss/main.scss'
11+
12+
all-hooks.json: py_env make_all_hooks.py
13+
sh -c '. py_env/bin/activate && python make_all_hooks.py'
14+
15+
index.html hooks.html: py_env all-hooks.json base.mako index.mako hooks.mako make_templates.py
16+
sh -c '. py_env/bin/activate && python make_templates.py'
17+
18+
install-local.py: py_env make_bootstrap.py
19+
sh -c '. py_env/bin/activate && python make_bootstrap.py'
1220

1321
py_env: requirements-dev.txt
22+
rm -rf py_env
1423
virtualenv py_env
15-
16-
bash -c 'source py_env/bin/activate && \
17-
pip install -r requirements-dev.txt'
24+
sh -c '. py_env/bin/activate && pip install -r requirements-dev.txt'
1825

1926
node_env: py_env
27+
rm -rf node_env
2028
bash -c 'source py_env/bin/activate && \
2129
nodeenv node_env --prebuilt && \
2230
source node_env/bin/activate && \
2331
npm install -g bower && \
2432
bower install'
2533

26-
install-local.py: py_env make_bootstrap.py
27-
bash -c '. py_env/bin/activate && \
28-
python make_bootstrap.py'
29-
3034
clean:
31-
rm -rf py_env node_env build bower_components
35+
rm -rf py_env node_env build bower_components *.html install-local.py all-hooks.json
3236

3337
build:
3438
[ -d build ] || mkdir build
3539

36-
open: scss
40+
.PHONY: open
41+
open: all
3742
(which google-chrome && google-chrome index.html) || \
3843
(which firefox && firefox index.html) &

all-repos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This files is used to generate all-hooks.json
22
- git://github.com/pre-commit/pre-commit-hooks
3+
- git://github.com/pre-commit/mirrors-coffeelint
4+
- git://github.com/pre-commit/mirrors-eslint
35
- git://github.com/pre-commit/mirrors-jshint
46
- git://github.com/pre-commit/mirrors-ruby-lint
57
- git://github.com/pre-commit/mirrors-scss-lint
6-
- git://github.com/pre-commit/mirrors-eslint
7-
- git://github.com/pre-commit/mirrors-coffeelint

base.mako

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
## -*- coding: utf-8 -*-
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6+
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet" type="text/css">
7+
<link rel="stylesheet" type="text/css" href="build/main.css">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<title>pre-commit by Yelp</title>
10+
</head>
11+
<body data-spy="scroll" data-target=".pc-sidebar">
12+
<header class="navbar navbar-default pc-nav" role="banner">
13+
<div class="container">
14+
<div class="navbar-header">
15+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".pc-navbar-collapse">
16+
<span class="sr-only">Toggle navigtaion</span>
17+
<span class="icon-bar"></span>
18+
<span class="icon-bar"></span>
19+
<span class="icon-bar"></span>
20+
</button>
21+
<a href="index.html" class="navbar-brand pc-navbar-brand">
22+
<i class="logo"></i>
23+
</a>
24+
</div>
25+
<nav class="navbar-collapse pc-navbar pc-navbar-collapse collapse" role="navigation">
26+
<ul class="nav navbar-nav">
27+
<li><a href="index.html">Documentation</a></li>
28+
<li><a href="hooks.html">Supported hooks</a></li>
29+
<li><a href="https://github.com/pre-commit/demo-repo#readme">Demo</a></li>
30+
</ul>
31+
<ul class="nav navbar-nav navbar-right">
32+
<li><a href="https://github.com/pre-commit/pre-commit" class="btn btn-default">Download on Github</a></li>
33+
</ul>
34+
</nav>
35+
</div>
36+
</header>
37+
<div class="top-shelf">
38+
<div class="container">
39+
<img class="pc-darwin hidden-xs" src="pre-commit-darwin.png">
40+
<h1>
41+
<a href="http://github.com/pre-commit/pre-commit">
42+
pre-commit
43+
<span class="nowrap">by Yelp</span>
44+
</a>
45+
</h1>
46+
<p>A framework for managing and maintaining multi-language <span class="nowrap">pre-commit</span> hooks.</p>
47+
<p><a href="https://travis-ci.org/pre-commit/pre-commit"><img src="https://camo.githubusercontent.com/ea0ef9a42d3a39bf0a55b3f5d7d7a6fa5254bd01/68747470733a2f2f7472617669732d63692e6f72672f7072652d636f6d6d69742f7072652d636f6d6d69742e7376673f6272616e63683d6d6173746572" alt="Build Status" data-canonical-src="https://travis-ci.org/pre-commit/pre-commit.svg?branch=master" style="max-width:100%;"></a>
48+
<a href="https://coveralls.io/r/pre-commit/pre-commit"><img src="https://camo.githubusercontent.com/aabc8c9324e9f816adc399bc2b29ca98e781a71e/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f7072652d636f6d6d69742f7072652d636f6d6d69742e7376673f6272616e63683d6d6173746572" alt="Coverage Status" data-canonical-src="https://img.shields.io/coveralls/pre-commit/pre-commit.svg?branch=master" style="max-width:100%;"></a></p>
49+
</div>
50+
</div>
51+
<div class="container pc-main-content">
52+
<div class="row">${self.body()}</div>
53+
</div>
54+
<footer class="pc-footer">
55+
<div class="container">
56+
Brought to you by <a href="http://www.yelp.com">Yelp</a>.
57+
</div>
58+
</footer>
59+
<script src="bower_components/jquery/jquery.min.js"></script>
60+
<script src="bower_components/bootstrap-sass/dist/js/bootstrap.min.js"></script>
61+
<script>
62+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
63+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
64+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
65+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
66+
67+
ga('create', 'UA-53969031-1', 'auto');
68+
ga('send', 'pageview');
69+
</script>
70+
</body>
71+
</html>

hooks.mako

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## -*- coding: utf-8 -*-
2+
<%inherit file="base.mako" />
3+
4+
<h1>Supported hooks</h1>
5+
6+
<p>
7+
To add to this list, fork <a href="https://github.com/pre-commit/pre-commit.github.io">this repository</a>.
8+
</p>
9+
10+
<p>
11+
Also available in <a href="/all-hooks.json">json</a>.
12+
</p>
13+
14+
% for repository, hooks in all_hooks.items():
15+
<h3>
16+
<a href="${repository.replace('git://', 'https://')}" target="_blank">
17+
${repository.replace('git://', '')}
18+
</a>
19+
</h3>
20+
<ul>
21+
% for hook_dict in hooks:
22+
<li>
23+
<code>${hook_dict['id']}</code>
24+
% if 'description' in hook_dict:
25+
- ${hook_dict['description']}
26+
% elif hook_dict['name'].lower() != hook_dict['id'].lower():
27+
- ${hook_dict['name']}
28+
% endif
29+
</li>
30+
% endfor
31+
</ul>
32+
% endfor

0 commit comments

Comments
 (0)