Skip to content

Instantly share code, notes, and snippets.

@gobijan
Last active December 30, 2015 16:39
Show Gist options
  • Save gobijan/7855936 to your computer and use it in GitHub Desktop.
Save gobijan/7855936 to your computer and use it in GitHub Desktop.
chocolat autopep8 mixin
var execFile = require('child_process').execFile;
Hooks.addMenuItem("Actions/Python/autopep8", "cmd-alt-l", function() {
var type = Document.current().rootScope();
if ('python.source'.indexOf(type) !== -1) {
execFile("/usr/local/bin/autopep8", ["--aggressive", Document.current().path()], function(error, stdout, stderr) {
Recipe.run(function(recipe) {
recipe.text = stdout;
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment