From bd89067f39c80b05b6d8e049ab9cf69ae81b408b Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 23 Feb 2011 20:42:36 -0800 Subject: [PATCH 1/8] First pages commit --- index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..fedf5ef --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +My github page From 5c3053db37bf746989f68b9d3f388bd28a620360 Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 23 Feb 2011 21:38:22 -0800 Subject: [PATCH 2/8] A basic pre-commit homepage. --- index.html | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index fedf5ef..5a125e6 100644 --- a/index.html +++ b/index.html @@ -1 +1,117 @@ -My github page + + + + pre-commit + + + + + +

pre-commit

+ +
+ +

pre-commit checks your code for errors before you commit it.

+ +

pre-commit is configurable.

+ +

Check for merge conflicts

+

Make sure you don't commit a merge conflict

+
+

$ git commit

+

pre-commit: detected a merge conflict

+

lib/foo.rb:13 <<<<<<< HEAD

+

 

+

You can bypass this check using `git commit -n`

+
+ +

Check for console.log

+

Everyone adds console.log statements to help debug javascript. Make sure you don't accidentally commit one.

+
+

$ git commit

+

pre-commit: console.log found

+

public/javascripts/application.js:64 console.log('checking something');

+

 

+

You can bypass this check using `git commit -n`

+
+ +

More checks

+

pre-commit comes with a variety of checks that you can turn on or off.

+
    +
  • debugger: make sure you don't commit a debugger statement
  • +
  • tabs: make sure your code uses leading spaces instead of tabs
  • +
  • whitespace: make sure you don't commit trailing whitespace
  • +
  • jslint: syntax check your javascript before you commit it
  • +
+ +

Install

+
+

$ gem install pre-commit

+

$ pre-commit install

+
+ +

Bugs

+

Please report bugs to github's issue tracker.

+ +
+ + + + + From 78bc5a540a295b95727ba90b3f2ab5dd2fe2636d Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 29 Jun 2011 19:01:13 -0700 Subject: [PATCH 3/8] Does github recognize subdirectories? --- checks/ci/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 checks/ci/index.html diff --git a/checks/ci/index.html b/checks/ci/index.html new file mode 100644 index 0000000..aa161ff --- /dev/null +++ b/checks/ci/index.html @@ -0,0 +1,12 @@ + + + + Ci Check + + + + +

Test

+ + + From 59df733b37a1f8ef241c5fc4d7601ed833c6fde6 Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 29 Jun 2011 19:13:00 -0700 Subject: [PATCH 4/8] Moving css to an external file. --- css/master.css | 52 ++++++++++++++++++++++++++++++++++++++++++++++ index.html | 56 ++------------------------------------------------ 2 files changed, 54 insertions(+), 54 deletions(-) create mode 100644 css/master.css diff --git a/css/master.css b/css/master.css new file mode 100644 index 0000000..e32e59f --- /dev/null +++ b/css/master.css @@ -0,0 +1,52 @@ + +body { + font-family: Arial; +} + +#container { + border: 1px solid #ddd; + margin: auto; + padding: 0 15px; + width: 500px; + + border-radius: 10px; +} + +h1 { + margin: 20px auto 10px; + width: 500px; +} + +h2 { + color: #d22; +} + +code { + font-family: monaco, monospace; + font-size: 9pt; +} + +.terminal { + background: #222; + color: #ddd; + font-family: monaco, monospace; + font-size: 9pt; + padding: 6px 8px; + + border-radius: 10px; +} + +.terminal p { + margin: 0; +} + +#footer { + font-size: .85em; + margin: 10px auto 20px; + text-align: right; + width: 500px; +} + +#footer p { + margin: 0; +} diff --git a/index.html b/index.html index 5a125e6..8f19545 100644 --- a/index.html +++ b/index.html @@ -2,61 +2,9 @@ pre-commit - - - + +

pre-commit

From 3fbdf3ae2b67a3d7914fa65a3bccf624ac75350d Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 29 Jun 2011 20:13:51 -0700 Subject: [PATCH 5/8] Adding a ci check documentation page. --- checks/ci/index.html | 40 ++++++++++++++++++++++++++++++++++++++-- css/master.css | 4 ++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/checks/ci/index.html b/checks/ci/index.html index aa161ff..6d47de5 100644 --- a/checks/ci/index.html +++ b/checks/ci/index.html @@ -1,12 +1,48 @@ - Ci Check + CI Check + -

Test

+

pre-commit

+ +
+

CI Check

+ +

If you turn on the ci check, it will look for and run a rake task called pre_commit:ci before each commit.

+ +

Example output:

+ +
+

$ git commit

+

pre-commit: your test suite has failed

+

for the full output run `pre_commit:ci`

+

 

+

You can bypass this check using `git commit -n`

+
+ +

Troubleshooting

+ +
+

$ git commit

+

pre-commit: skipping ci check. The `pre_commit:ci` task is not defined.

+
+ +

If you see a message like this, you need to define a rake task called pre_commit:ci.

+ +

If you're using test/unit you can point the pre_commit:ci task to run your test suite like this:

+ +
+        namespace :pre_commit do
+          task :ci => [:test]
+        end
+      
+ +

Or you can define your own custom pre_commit:ci task. This could, for example, run a small test suite of core tests. This small test suite should run very quickly. Remember, you're going to be running this test before every commit.

+
diff --git a/css/master.css b/css/master.css index e32e59f..1c6d16a 100644 --- a/css/master.css +++ b/css/master.css @@ -5,7 +5,7 @@ body { #container { border: 1px solid #ddd; - margin: auto; + margin: 1em auto 1em; padding: 0 15px; width: 500px; @@ -31,7 +31,7 @@ code { color: #ddd; font-family: monaco, monospace; font-size: 9pt; - padding: 6px 8px; + padding: 11px 12px; border-radius: 10px; } From 4468991475d2b091dd4722ebf23607e667c843fd Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 29 Jun 2011 20:20:08 -0700 Subject: [PATCH 6/8] Adding documentation for the ci check. --- checks/ci/index.html | 1 + index.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/checks/ci/index.html b/checks/ci/index.html index 6d47de5..c44477f 100644 --- a/checks/ci/index.html +++ b/checks/ci/index.html @@ -3,6 +3,7 @@ CI Check + diff --git a/index.html b/index.html index 8f19545..0928957 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ pre-commit + @@ -42,6 +43,7 @@

More checks

  • tabs: make sure your code uses leading spaces instead of tabs
  • whitespace: make sure you don't commit trailing whitespace
  • jslint: syntax check your javascript before you commit it
  • +
  • ci: run a quick test suite before you commit more…
  • Install

    From 2236c455165aee7d40f39f5b4f3eb8f9f3255707 Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 29 Jun 2011 20:21:32 -0700 Subject: [PATCH 7/8] Using relative urls for the css file. gh-pages puts everything underneath a `/pre-commit/` folder. This makes absolute urls break =/. Using a relative url instead. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 0928957..285c45b 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ pre-commit - + From 79527ab32db1aad5e5b5da36d65aff3768a855fa Mon Sep 17 00:00:00 2001 From: Josh Lubaway Date: Wed, 29 Jun 2011 20:23:40 -0700 Subject: [PATCH 8/8] Using absolute urls for css files. --- checks/ci/index.html | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/ci/index.html b/checks/ci/index.html index c44477f..ed91699 100644 --- a/checks/ci/index.html +++ b/checks/ci/index.html @@ -2,7 +2,7 @@ CI Check - + diff --git a/index.html b/index.html index 285c45b..9b57c52 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ pre-commit - +