Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Thursday, May 28, 2015

pep8

I've got very comfortable with clang-format for C++ and gofmt for Go. Every time I have to use some other language i'm missing them very much. Today I've found a solution for Python. It makes life so much easier. The two awesome tools are:

pep8

pep8 is a tool to check your Python code against some of the style conventions in PEP 8.
https://pypi.python.org/pypi/pep8

autopep8

autopep8 automatically formats Python code to conform to the PEP 8 style guide. It uses the pep8 utility to determine what parts of the code needs to be formatted. autopep8 is capable of fixing most of the formatting issues that can be reported by pep8.
https://github.com/hhatto/autopep8

Wednesday, April 22, 2015

Reflex - trigger an execution of command on a file change event

How many times you were working on some tiny project that needs to be rebuild / restarted after you modify the code? I guess often.

After experimenting with some solutions I found an ultimate one: https://github.com/cespare/reflex
Installation:
go get github.com/cespare/reflex
Automatically recompiling markdown file into html every time the file is changed:
reflex -r '\.md$' blackfriday-tool -page article.md article.html
Or you can restart Go app when saved files:
reflex -r '\.go$' -- go run main.go