• Dridi Boukelmoune's avatar
    Style(9) and whitespace OCD · dd28fc73
    Dridi Boukelmoune authored
    Dealing with code style violations around the return keyword, I figured
    I could automate that fix, so I tried with my favourite refactoring tool
    and following those steps:
    
        $ cat >return.cocci <<EOF
        @@
        expression rv;
        @@
    
        - return rv;
        + return (rv);
        EOF
        $ spatch --dir . --in-place --sp-file return.cocci
    
    Unfortunately that leads to proper return statements having their return
    value enclosed twice, like `return ((rv))`. So a bit more steps to go:
    
        $ cat >rereturn.cocci <<EOF
        @@
        expression rv;
        @@
    
        - return ((rv));
        + return (rv);
        EOF
        $ spatch --dir . --in-place --sp-file rreeturn.cocci
    
    At this point you don't want to touch bundled code, right? So let's take
    care of libvgz and shout out to teken that saw no changes at all!
    
        $ git checkout -- lib/libvgz/
    
    The next step is to manually review all the changes, because Coccinelle
    is not aware of how we break lines and unbreaks them. That's quite
    tedious but I was waiting for someone and they are still late as I'm
    describing the whole process.
    
    Care was taken not to touch varnishtest to make it easier to sync with
    vtest. A dedicated patch will follow.
    dd28fc73
Name
Last commit
Last update
..
Makefile.am Loading commit data...
daemon.c Loading commit data...
flint.lnt Loading commit data...
flint.sh Loading commit data...
generate.py Loading commit data...
libvarnishapi.map Loading commit data...
vsc.c Loading commit data...
vsig.c Loading commit data...
vsl.c Loading commit data...
vsl2rst.c Loading commit data...
vsl_api.h Loading commit data...
vsl_arg.c Loading commit data...
vsl_cursor.c Loading commit data...
vsl_dispatch.c Loading commit data...
vsl_glob_test.c Loading commit data...
vsl_query.c Loading commit data...
vsm.c Loading commit data...
vut.c Loading commit data...
vxp.c Loading commit data...
vxp.h Loading commit data...
vxp_lexer.c Loading commit data...
vxp_parse.c Loading commit data...
vxp_test.c Loading commit data...