diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2012-03-22 12:33:35 +0100 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-03-26 14:45:22 -0600 |
commit | a8e031a749d4e67a27cb2004b7c50f0456ecc401 (patch) | |
tree | c28bf861d9a399304d639c4e15268613a65613e4 /libvirt-override.py | |
parent | dc2f75d35a6461c896a738d092dc973067d0dbd4 (diff) | |
download | libvirt-python-v6-a8e031a749d4e67a27cb2004b7c50f0456ecc401.tar.gz libvirt-python-v6-a8e031a749d4e67a27cb2004b7c50f0456ecc401.tar.xz libvirt-python-v6-a8e031a749d4e67a27cb2004b7c50f0456ecc401.zip |
Cleanup for a return statement in source files
Return statements with parameter enclosed in parentheses were modified
and parentheses were removed. The whole change was scripted, here is how:
List of files was obtained using this command:
git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \
grep -e '\.[ch]$' -e '\.py$'
Found files were modified with this command:
sed -i -e \
's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
Then checked for nonsense.
The whole command looks like this:
git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \
grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e \
's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
-e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
Diffstat (limited to 'libvirt-override.py')
0 files changed, 0 insertions, 0 deletions