Re: Script to format the functions in a C header?



You could use clang-format and an appropriately configured
.clang-format file to enforce coding convention within a source
tree.

I'd recommend checking: https://clangformat.com/ as a simple way
to build your .clang-format

I tend to keep an "update_format.sh" script in my repos to ensure
everything stays sane during development:

#!/bin/bash
clang-format -i $(find . -name '*.[ch]')

# Check we have no typos.
which misspell 2>/dev/null >/dev/null
if [[ $? -eq 0 ]]; then
    misspell -error $(find . -name '*.[ch]')
fi


Note that misspell is a golang package, and makes sure I have
no embarrassing typos in my code :) "diffrent" happens so often..

- ikey

On 20/11/16 10:19, Sébastien Wilmet wrote:
Hi,

Is there a script to format the function prototypes in a C header, with
the GNOME conventions? I.e. aligning the function names on the same
column, aligning the parameters, etc.

Thanks,
Sébastien
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]