Auto post-commit PEP8 correction

It’s always an hateful job to correct PEP8 warnings manually.

$ flake8 billy --ignore=E501,W293
billy/tests/integration/test_basic.py:401:45: W291 trailing whitespace
billy/models/processors/balanced_payments.py:116:44: W291 trailing whitespace
billy/models/processors/balanced_payments.py:133:30: W291 trailing whitespace

I bet you don’t like this either. Today I cannot take it anymore. I was wondering, why I should do this thing machine should do? So I seek solutions on the Internet, and I found an article looks helpful - Syntax+pep8 checking before committing in git. The basic idea is to add a pre-commit hook script to git for checking PEP8 syntax before commit. By doing that, you cannot commit code with PEP8 warnings anymore, when you do, you see errors like this

...

read the full article

Technical debts

When you buy a house, you raise a mortgage. When you buy a car, you raise an auto loan. Maybe you are rich enough to clear all the debts at once, but anyway, we all live with debts, more or less. In fact, for software developers, we all live with debts as well. They’re so called technical debts. I really like the debt analog, technical debts are similar to debts in real life. Funny enough, most of people know how real debts work, but technical debts are not well known by developers. However, it makes sense. People live with the idea of debts maybe for thousands years, but there are only few decades history of computer.

...

read the full article

Keep a readable Git history

Readability of code is important, there is a fact

Code is read more than it is written

This is so true, even when you are writing code, actually, you need to read the current code base again and again. Back to the ancient programming era, people are still using forbidden black magic - goto statements. Powered by the black magic, there is a demon Spaghetti code, and it looks like this

(From http://en.wikipedia.org/wiki/File:Spaghetti.jpg under Creative Commons 2.0 license)

...

read the full article

Fall in love with continuous testing and integration - Travis-CI

You know, testing is important for software development. With good continuous integration and testing there, you have confidence that your software has a certain quality. It doesn’t mean your software is prefect then, however, when things broken, you can catch them and fix it. Jenkins is a pretty awesome and easy-to-use open source continuous integration tool, but for developing my own hobby open source projects, I just don’t want to rent a server and run Jenkins. So, I am always wondering, wouldn’t it be nice to have something like CI as service? I can just put my code there, and it could do the rest for me.

...

read the full article