Using ansible-lint with Git's pre-commit

While browsing randomly, I stumbled upon the linter for Ansible called, you guess it, ansible-lint. However, another interesting utility came up called pre-commit, which is a framework to manage your Git's pre-commit hooks.

Installation is simple. Use `pip` to install it.
$ sudo -H pip install pre-commit

Create the config file, `.pre-commit-config.yaml` and add the content below.
- repo: https://github.com/willthames/ansible-lint.git
  sha: v3.3.3
  hooks:
    - id: ansible-lint
      files: \.(yaml|yml)$


Install the necessary tool.
$ pre-commit autoupdate
Updating https://github.com/willthames/ansible-lint.git...already up to date.

Install to the repository's `pre-commit` hook.
$ pre-commit install
pre-commit installed at /home/ang/src/dotfiles-ansible/.git/hooks/pre-commit
$ git commit
[INFO] Installing environment for https://github.com/willthames/ansible-lint.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...

This Week I Learned - 2017 Week 03

Last week post or the whole series.

#1 Having trouble finishing any personal side projects as a developer? Rethink the purpose on why you want to start a side projects? Don't be so hard on yourself, nobody is keeping scores and gives a crap. Do it because you want to learn, experiment, and have some fun along the way. However, keep the coding streak going. Don't overwhelmed yourself, it's not a full time job. Also, do not fall into the trap of researching more than doing ala analysis paralysis, a common behaviour when you're starting a new venture or hobbies and get overly excited.

#2 ShewhartJuran, and Deming. The giants of Total Quality Management (TQM) and theory. Humphrey applied these theories to software quality and thus, leads to the development of Software Engineering Institute (SEI), Capability Maturity Model (CMM), and Capability Maturity Model Integration (CMMI). Can quality theory used for manufacturing translates well to software development? Depends. Highly for embedded system development but doubt so for normal web development.

On a related note, can we apply these quality models and theories to our personal productivity and optimize our habits? If we consistently miss our commitments to our self, isn't that a symptoms of process failure? Hence, if we fix the process and thus fix our habits, can we increase the probability of the success of our commitments? Also can we apply CMMI's capability level to personal financial planning? That's food for thought. Again, this is a possible interesting idea, daily SCRUM family meeting. I've tried something similar with limited success. Feedback from SO is that it's too formal and too rigid.

#3 Keep up with fast changes of development field? Don't do front-end stuff. Don't follow the flash-in-the-pan (hot) technologies. Learn durable skills. Study and take online classes. Be a generalist? Don't think so. While we're still thinking on what hottest technologies or practices to use, ask yourself "when is practice X useful?" instead of "is practice X a good idea?" Good example is the numerous Agile practices, there are so many and not every one is applicable for your organization. One little gem I learned, Agile is used primary to solve communication or requirements issues. And also, another example of those practices is the use of monorepo, even through you're using a distributed version control system.

#4 T(Type) Driven Design over T(Test) Driven Design. Interesting indeed. Instead of embracing T(Test)DD, the problem can be partially solved by switching to a statically type programming languages. For example, switching from Python/Perl/PHP to Golang?

#5 While watching the short documentary series Mind Field on the subject on isolation, little I realized that boredom is the result of your brain lacking stimulation and worse, and epidemic psychological behaviour will little scientific studies.  Moreover, researches have identified that there are different types of boredom. Interestingly, Plutchik's wheel of emotions grouped the emotion of boredom with disgust and loathing. No wonder philosopher, Søren Kierkegaard said "boredom is the root of all evil" (or is it creativity?). How to prevent our self from succumb to boredom? Thinking about boredom itself, why something bores you. Or because we've become habituated? Maybe practice gratitude is an alternative way to resolve that?

#6 The Old School Object Oriented Perl (OSOOP). Yes, the bless-way. As I mentioned many times, specifically, Perl is a text processing programming language with multiple ways of doing things. Hence, OO supports is to the bare essentials, there is not syntactic sugar what so ever. If you're creating a CPAN module, best to use lightweight Moo package, which was designed for that purpose.