Skip to content

Commit

Permalink
Reorganize build, add hooks page.
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Aug 27, 2014
1 parent 93b58b6 commit 23578ae
Show file tree
Hide file tree
Showing 10 changed files with 430 additions and 395 deletions.
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
*.html
*.iml
*.swp
.DS_Store
.idea
.project
.pydevproject
py_env
node_env
*.swp
all-hooks.json
bower_components
.DS_Store
build
install-local.py
node_env
py_env
33 changes: 19 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
# To build scss continuously I use `watch -n 0.1 make build/main.css`

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

.PHONY: install_pre_commit
install_pre_commit: py_env
bash -c 'source py_env/bin/activate && \
pre-commit install'
sh -c '. py_env/bin/activate && pre-commit install'

build/main.css: node_env build scss/main.scss scss/_variables.scss
bash -c 'source py_env/bin/activate && \
pyscss -o build/main.css scss/main.scss'
sh -c '. py_env/bin/activate && pyscss -o build/main.css scss/main.scss'

all-hooks.json: py_env make_all_hooks.py
sh -c '. py_env/bin/activate && python make_all_hooks.py'

index.html hooks.html: py_env all-hooks.json base.mako index.mako hooks.mako make_templates.py
sh -c '. py_env/bin/activate && python make_templates.py'

install-local.py: py_env make_bootstrap.py
sh -c '. py_env/bin/activate && python make_bootstrap.py'

py_env: requirements-dev.txt
rm -rf py_env
virtualenv py_env

bash -c 'source py_env/bin/activate && \
pip install -r requirements-dev.txt'
sh -c '. py_env/bin/activate && pip install -r requirements-dev.txt'

node_env: py_env
rm -rf node_env
bash -c 'source py_env/bin/activate && \
nodeenv node_env --prebuilt && \
source node_env/bin/activate && \
npm install -g bower && \
bower install'

install-local.py: py_env make_bootstrap.py
bash -c '. py_env/bin/activate && \
python make_bootstrap.py'

clean:
rm -rf py_env node_env build bower_components
rm -rf py_env node_env build bower_components *.html install-local.py all-hooks.json

build:
[ -d build ] || mkdir build

open: scss
.PHONY: open
open: all
(which google-chrome && google-chrome index.html) || \
(which firefox && firefox index.html) &
4 changes: 2 additions & 2 deletions all-repos.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This files is used to generate all-hooks.json
- git://github.com/pre-commit/pre-commit-hooks
- git://github.com/pre-commit/mirrors-coffeelint
- git://github.com/pre-commit/mirrors-eslint
- git://github.com/pre-commit/mirrors-jshint
- git://github.com/pre-commit/mirrors-ruby-lint
- git://github.com/pre-commit/mirrors-scss-lint
- git://github.com/pre-commit/mirrors-eslint
- git://github.com/pre-commit/mirrors-coffeelint
71 changes: 71 additions & 0 deletions base.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## -*- coding: utf-8 -*-
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="build/main.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>pre-commit by Yelp</title>
</head>
<body data-spy="scroll" data-target=".pc-sidebar">
<header class="navbar navbar-default pc-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".pc-navbar-collapse">
<span class="sr-only">Toggle navigtaion</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.html" class="navbar-brand pc-navbar-brand">
<i class="logo"></i>
</a>
</div>
<nav class="navbar-collapse pc-navbar pc-navbar-collapse collapse" role="navigation">
<ul class="nav navbar-nav">
<li><a href="index.html">Documentation</a></li>
<li><a href="hooks.html">Supported hooks</a></li>
<li><a href="https://github.com/pre-commit/demo-repo#readme">Demo</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/pre-commit/pre-commit" class="btn btn-default">Download on Github</a></li>
</ul>
</nav>
</div>
</header>
<div class="top-shelf">
<div class="container">
<img class="pc-darwin hidden-xs" src="pre-commit-darwin.png">
<h1>
<a href="http://github.com/pre-commit/pre-commit">
pre-commit
<span class="nowrap">by Yelp</span>
</a>
</h1>
<p>A framework for managing and maintaining multi-language <span class="nowrap">pre-commit</span> hooks.</p>
<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>
<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>
</div>
</div>
<div class="container pc-main-content">
<div class="row">${self.body()}</div>
</div>
<footer class="pc-footer">
<div class="container">
Brought to you by <a href="http://www.yelp.com">Yelp</a>.
</div>
</footer>
<script src="bower_components/jquery/jquery.min.js"></script>
<script src="bower_components/bootstrap-sass/dist/js/bootstrap.min.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-53969031-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
32 changes: 32 additions & 0 deletions hooks.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## -*- coding: utf-8 -*-
<%inherit file="base.mako" />

<h1>Supported hooks</h1>

<p>
To add to this list, fork <a href="https://github.com/pre-commit/pre-commit.github.io">this repository</a>.
</p>

<p>
Also available in <a href="/all-hooks.json">json</a>.
</p>

% for repository, hooks in all_hooks.items():
<h3>
<a href="${repository.replace('git://', 'https://')}" target="_blank">
${repository.replace('git://', '')}
</a>
</h3>
<ul>
% for hook_dict in hooks:
<li>
<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
Loading

0 comments on commit 23578ae

Please sign in to comment.