Semi-automated coding style cleanup
parent
cbd8cc0636
commit
77eb2440e3
|
@ -0,0 +1,18 @@
|
|||
Some cleanup commands :
|
||||
|
||||
To add a space after each comma :
|
||||
sed -e "s/\(\w\),\(\w\)/\1, \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
|
||||
To add spaces around each = :
|
||||
sed -e "s/\(\w\)=\(\w\)/\1 = \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
sed -e "s/\(\w\)=\(\"\)/\1 = \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
sed -e "s/\(\w\)=\((\)/\1 = \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
|
||||
To add spaces around each == :
|
||||
sed -e "s/\(\w\)==\(\w\)/\1 == \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
sed -e "s/\(\w\)==\(\"\)/\1 == \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
sed -e "s/\(\w\)==\((\)/\1 == \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
sed -e "s/\()\)==\(\w\)/\1 == \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
sed -e "s/\()\)==\((\)/\1 == \2/g" -i *.py printrun/*.py printrun/svg/*.py
|
||||
|
||||
Obviously this is not a perfect solution, it WILL break the code. Juste check the diff and fix what's wrong before commiting.
|
Loading…
Reference in New Issue