diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebKitTools/Scripts/wkstyle | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebKitTools/Scripts/wkstyle')
-rwxr-xr-x | WebKitTools/Scripts/wkstyle | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/WebKitTools/Scripts/wkstyle b/WebKitTools/Scripts/wkstyle index 690b5fa..4b3447f 100755 --- a/WebKitTools/Scripts/wkstyle +++ b/WebKitTools/Scripts/wkstyle @@ -25,16 +25,36 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -astyle \ +cmdcpp="astyle \ +--unpad=paren \ --style=linux \ +--brackets=linux \ --indent=spaces=4 \ ---convert-tabs \ -$@ +--indent-switches \ +--convert-tabs" + +cmdh="astyle \ +--unpad=paren \ +--style=linux \ +--brackets=break \ +--indent=spaces=4 \ +--convert-tabs" #astyle does not support unpadding so we use sed for i in $@ do echo $i + +ext=`echo $i|awk -F . '{print $NF}'` + +cmd=$cmdcpp + +if [ $ext == "h" ] ; then + cmd=$cmdh +fi + +$cmd $i + #first print the changes we are making sed -n -e ' /( .*/p @@ -59,6 +79,9 @@ s/ )/)/g N s/\n{/ {/ } +#fixup extra tab in constructor initalizer +/^ \+,/{s/^ //} +/^ \+:/{s/^ //} ' $i > $i.sed mv $i.sed $i done |