Skip to content

Instantly share code, notes, and snippets.

@joshourisman
Created July 14, 2011 19:19
Show Gist options
  • Save joshourisman/1083208 to your computer and use it in GitHub Desktop.
Save joshourisman/1083208 to your computer and use it in GitHub Desktop.
import os
import sublime
import sublime_plugin
class Pep8CheckCommand(sublime_plugin.EventListener):
def on_post_save(self, view):
if view.file_name().endswith('.py'):
folder_name, file_name = os.path.split(view.file_name())
view.window().run_command('exec', {'cmd': ['flake8',
file_name], 'working_dir': folder_name})
sublime.status_message("pep8 " + file_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment