From d8a762c4276e7b330d3d0051e2b6a0dc063af287 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke <marijnh@gmail.com>
Date: Tue, 2 Apr 2013 12:04:11 +0200
Subject: [PATCH] Add a bin/lint for easy running of the linter

---
 CONTRIBUTING.md |  8 +++++---
 bin/lint        | 11 +++++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)
 create mode 100755 bin/lint

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index afc18373c..4e040ff19 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -56,6 +56,8 @@ should be asked on the
   test suite under `mode/XXX/test.js`. Feel free to add new test
   suites to modes that don't have one yet (be sure to link the new
   tests into `test/index.html`).
+- Follow the general code style of the rest of the project (see
+  below). Run `bin/lint` to verify that the linter is happy.
 - Make sure all tests pass. Visit `test/index.html` in your browser to
   run them.
 - Submit a pull request
@@ -65,6 +67,6 @@ should be asked on the
 
 - 2 spaces per indentation level, no tabs.
 - Include semicolons after statements.
-- Note that the linter (`test/lint/lint.js`) which is run after each
-  commit complains about unused variables and functions. Prefix their
-  names with an underscore to muffle it.
+- Note that the linter (`bin/lint`) which is run after each commit
+  complains about unused variables and functions. Prefix their names
+  with an underscore to muffle it.
diff --git a/bin/lint b/bin/lint
new file mode 100755
index 000000000..3b6338691
--- /dev/null
+++ b/bin/lint
@@ -0,0 +1,11 @@
+#!/usr/bin/env node
+
+var lint = require("../test/lint/lint");
+
+process.chdir(__dirname.slice(0, __dirname.lastIndexOf("/")));
+
+lint.checkDir("mode");
+lint.checkDir("lib");
+lint.checkDir("addon");
+
+process.exit(lint.success() ? 0 : 1);
-- 
GitLab