Skip to content

Instantly share code, notes, and snippets.

@osya
Created February 20, 2018 10:08
Show Gist options
  • Save osya/b05d81d0c23c6a51e2b3749fb771f000 to your computer and use it in GitHub Desktop.
Save osya/b05d81d0c23c6a51e2b3749fb771f000 to your computer and use it in GitHub Desktop.
Execute `yapf` for all files in a directory #Python
import glob
import subprocess
files = glob.iglob('E:/Work/web-frameworks/Python/**/*.py', recursive=True)
files_i_care_about = filter(lambda x: all(e not in x for e in ('venv', 'DjangoRESTPostgres')), files)
for filename in files_i_care_about:
subprocess.call(['yapf', '-vv', '-i', filename])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment