<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git-hook-pre-commit-python-javascript-syntax-linter/t, branch master</title>
<subtitle>Before committing run `flake8` and `jshint` on staged files</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/git-hook-pre-commit-python-javascript-syntax-linter/'/>
<entry>
<title>Add JavaScript linting and tests</title>
<updated>2015-09-27T17:20:55+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2015-09-27T17:20:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/git-hook-pre-commit-python-javascript-syntax-linter/commit/?id=2a88fb92f4c1fbb3533e589d5c9f4b5c17595d3f'/>
<id>2a88fb92f4c1fbb3533e589d5c9f4b5c17595d3f</id>
<content type='text'>
* Add sample malformed JavaScript files to lint on
* In our tests, copy the `node_modules` directory to make `jshint`
  available, then validate that we're correctly linting the staged JS
  file
* In our pre-commit hook, lint the staged JavaScript files. If either of
  our linting commands fail then exit 1 to abort the commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add sample malformed JavaScript files to lint on
* In our tests, copy the `node_modules` directory to make `jshint`
  available, then validate that we're correctly linting the staged JS
  file
* In our pre-commit hook, lint the staged JavaScript files. If either of
  our linting commands fail then exit 1 to abort the commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>t/100-python.t: Perform a `git reset` at test's end</title>
<updated>2015-09-27T17:19:01+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2015-09-27T17:19:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/git-hook-pre-commit-python-javascript-syntax-linter/commit/?id=50631f85e73eda9d6738f5993ff5cf26198f8697'/>
<id>50631f85e73eda9d6738f5993ff5cf26198f8697</id>
<content type='text'>
Ensure we reset the staging area as a teardow/cleanup operation.
Otherwise, our JavaScript test (which runs after this one by default)
will be working with a dirty staging area and its test will by
consequence not pass.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure we reset the staging area as a teardow/cleanup operation.
Otherwise, our JavaScript test (which runs after this one by default)
will be working with a dirty staging area and its test will by
consequence not pass.
</pre>
</div>
</content>
</entry>
<entry>
<title>t/100-python.t: Restrict file check to Python files</title>
<updated>2015-09-27T17:16:22+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2015-09-27T17:16:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/git-hook-pre-commit-python-javascript-syntax-linter/commit/?id=7096e275b8d2d78ecfbb8d53f22086fd0e8d0605'/>
<id>7096e275b8d2d78ecfbb8d53f22086fd0e8d0605</id>
<content type='text'>
One of our tests confirms that our 2 Python files are in the repo
directory. Since we're also adding JavaScript files to this directory,
we need to restrict the test to Python files in order to match them
correctly. In this case since we're only testing Python files we don't
really need to worry about the JS files' existence.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
One of our tests confirms that our 2 Python files are in the repo
directory. Since we're also adding JavaScript files to this directory,
we need to restrict the test to Python files in order to match them
correctly. In this case since we're only testing Python files we don't
really need to worry about the JS files' existence.
</pre>
</div>
</content>
</entry>
<entry>
<title>Create 'pre-commit', add Python tests</title>
<updated>2015-09-25T05:02:27+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2015-09-25T05:02:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/git-hook-pre-commit-python-javascript-syntax-linter/commit/?id=efa1909b2fa955e5170eecda8d1d42598c817f07'/>
<id>efa1909b2fa955e5170eecda8d1d42598c817f07</id>
<content type='text'>
* Create our 'pre-commit' hook script that runs flake8 on Python files in
  the staging area.
* Update test setup to create a git repository for testing.
* Add a test for the Python linter to confirm that it produces the
  correct output when trying to commit and that it only checks files in
  the staging index.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Create our 'pre-commit' hook script that runs flake8 on Python files in
  the staging area.
* Update test setup to create a git repository for testing.
* Add a test for the Python linter to confirm that it produces the
  correct output when trying to commit and that it only checks files in
  the staging index.
</pre>
</div>
</content>
</entry>
<entry>
<title>Test setup</title>
<updated>2015-09-24T02:04:35+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2015-09-24T02:04:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/git-hook-pre-commit-python-javascript-syntax-linter/commit/?id=f6bb0d359c7c46eb41a3d760a85f2cc2aad3a79d'/>
<id>f6bb0d359c7c46eb41a3d760a85f2cc2aad3a79d</id>
<content type='text'>
* Add Makefile with test target/goal copied from Richard Hartmann's
  vcsh. Now that I think about it, I really need to change that because
  vcsh is GPL. Will do that soon.
* Add setup and teardown test files that create a remove a directory.
  This directory will be a basic git repo where we'll install our git
  hook and then test output from different commits in the repo.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add Makefile with test target/goal copied from Richard Hartmann's
  vcsh. Now that I think about it, I really need to change that because
  vcsh is GPL. Will do that soon.
* Add setup and teardown test files that create a remove a directory.
  This directory will be a basic git repo where we'll install our git
  hook and then test output from different commits in the repo.
</pre>
</div>
</content>
</entry>
</feed>
