Skip to content

Instantly share code, notes, and snippets.

@DoctorMalboro
Created July 25, 2014 15:01
Show Gist options
  • Save DoctorMalboro/8ede58465fe9ca73c4c3 to your computer and use it in GitHub Desktop.
Save DoctorMalboro/8ede58465fe9ca73c4c3 to your computer and use it in GitHub Desktop.
Checks if there are any unused imports on your project. Requires snake-food to work.
# -*- coding: utf-8 -*-
import subprocess
if __name__ == '__main__':
fp = open('imports.txt', 'w+')
imports = subprocess.Popen('sfood-checker',
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
imports_output = imports.communicate()[0]
fp.write(imports_output)
fp.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment