Commit da13f90a authored by nimrod's avatar nimrod
Browse files

- Added post about my pre-commit hooks and my view on pre-commit's place in testing.

parent a07831da
Loading
Loading
Loading
Loading

content/pre-commit.rst

0 → 100644
+26 −0
Original line number Diff line number Diff line
Pre-commit hooks
################
:data: 2016-03-12
:summary: New pre-commit hooks I wrote

`Pre-commit <http://www.pre-commit.com>`_ is a nice, simple tool to add Git
hooks to your project. The primary goal is running fast checks on commits
(before committing them), mainly linters and syntax checkers. Today I've 2 of my
own, for Ansible playbooks and shell scripts. The Ansible playbooks hook is
located at https://www.shore.co.il/git/ansible-pre-commit/ and the shell scripts
hook is at https://www.shore.co.il/git/shell-pre-commit/. Both have a short
README which describes installation and usage.

My view on testing
------------------

I find that Pre-commit suites my view on proportionate testing. The smaller the
change, the faster the test (and as a result, more trivial). Personally, I 
prefer to structure my work as small commits that are easier to revert, these
deserve fast (and more trivial) tests which Pre-commit provides. The bigger the
change, the more rigorous (and thus longer) the test. In my opinion this helps
in creating a good workflow which quickly finds small errors while developing
and reduces the number of times one must ran the full test suite because he/she
had a typo that failed the test. This is why I prefer to separate the test
suite so that I can the ability to run the simpler and faster locally and get
rid of simple error quickly.