Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
blog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
blog
Commits
da13f90a
Commit
da13f90a
authored
9 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
- Added post about my pre-commit hooks and my view on pre-commit's place in testing.
parent
a07831da
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
content/pre-commit.rst
+26
-0
26 additions, 0 deletions
content/pre-commit.rst
with
26 additions
and
0 deletions
content/pre-commit.rst
0 → 100644
+
26
−
0
View file @
da13f90a
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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment