diff --git a/content/pre-commit.rst b/content/pre-commit.rst new file mode 100644 index 0000000000000000000000000000000000000000..a1e30a490e07583eadd643cb75d6db83541e5cc7 --- /dev/null +++ b/content/pre-commit.rst @@ -0,0 +1,26 @@ +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.