~launchpad-pqm/launchpad/devel

11645.1.1 by Gavin Panella
Simple script to format new and modified imports.
1
#!/usr/bin/env bash
2
#
3
# Reformat imports in new and modified files. Call without arguments
4
# to operate on uncommitted changes. Arguments will be passed to bzr
5
# status, so to operate on all new and modified files relative to the
6
# submit branch, use:
7
#
8
#   format-new-and-modified-imports -r submit:
9
#
10
11
bzr status --short "$@" | \
7675.879.14 by Gavin Panella
Fix format-new-and-modified-imports so that it DTRT for renamed files.
12
    awk '/^.[MN] .*[.]py$/ { print $NF }' | \
11645.1.1 by Gavin Panella
Simple script to format new and modified imports.
13
    xargs -r "$(dirname "$0")/format-imports"