#!/usr/bin/env python

import subprocess
subprocess.run([
    'yapf',
    '-i',
    '-r',
    '-e',
    'foodsaving/*/migrations',
    'foodsaving',
])

#!/usr/bin/env python

import subprocess
import sys
args = [
    'yapf',
    '-i',
    '-r',
    '-e',
    'foodsaving/*/migrations',
    'foodsaving',
    *sys.argv[1:],
]
print(' '.join(args))
subprocess.run(args)

Improve yapf.py script