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

On Mon, Nov 21, 2016 at 03:49:09PM +0000, Ikey Doherty wrote:
You could use clang-format and an appropriately configured
.clang-format file to enforce coding convention within a source

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

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

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]')

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

Ok, thanks, I can look at clang-format if it supports the GNOME/GTK+
convention for formatting function prototypes in a header.

Otherwise I can write a new script, and re-use some code from
(it's based on regexes, so it's clearly not ideal, but it does its job).


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