cra
mr

Integrating PyFlakes Into TextMate

You're viewing an archived post which may have broken links or images. If this post was valuable and you'd like me to restore it, let me know!

One of the things I really dislike about TextMate is we have no inline-error checking. The best you can achieve is showing a tooltip, and only when you save the file. There’s been a few attempts at doing this with things like JSLint and PyLint, but most of them fall short. Today I decided to correct that.

A great bundle out there for JavaScript developers exists already, JavaScript Tools TextMate Bundle. I’m not entirely sure who the original author is, but all in all, the bundle does its job well. It hooks the save hotkey and runs JSLint on your file, and gives you a bunch of other shiny tools as well. With Python there’s a few out there, but none really fit the workflow that I think is ideal: automation.

So based off the amazing JS tools bundle, I created a similar setup to use my PyFlakes fork. It hooks the save command, just like the JSLint bundle, and also gives you a quick lint HTML output by using Command + Shift + V (I’m not a big fan of the Control and Option keys, they dont feel right).

Upon saving, you get a nice tooltip describing the error, and whether its a Warning or Error:

If for some reason you have too many errors, or you want to bring this up in a more visible fashion, it also gives you the ability to render the results in a new window:

Anyways, without further adieu, check out the Python Tools TextMate Bundle on GitHub.