On 02/18/2016 11:05 AM, Peter Maydell wrote:
> Add a --all option which will run the script on every C
> source and header file in the repository (except for those
> in a few directories which contain standalone guest code).
> 
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
>  scripts/clean-includes | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 

> +# Regular expression defining files to ignore when using --all

s/Regular/Extended regular/, to make it obvious which flavor we are
using? (But yes to ERE; it's a pain to write \(..\|..\) in BRE).

> +XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios|disas/libvixl)'
> +
>  if [ $# -ne 0 ] && [ "$1" = "--git" ]; then

>  
> +if [ "$1" = "--all" ]; then
> +    # We assume there are no files in the tree with spaces in their name
> +    set -- $(git ls-files '*.[ch]' | egrep -v "$XDIRREGEX")

'grep -E' is slightly more portable than 'egrep'.

We could perhaps patch checkpatch.pl to enforce that no new files with
stupid names are checked in...

Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to