[Parted-edge] [PATCH] Create the needed infra-structure to enforce the coding style
Otavio Salvador
otavio at debian.org
Fri Jul 6 12:49:38 UTC 2007
Jim Meyering <jim at meyering.net> writes:
> "Debarshi 'Rishi' Ray" <debarshi.ray at gmail.com> wrote:
>>> indent --gnu-style
>>> --no-tabs
>>> -ppi 2
>>> --preserve-mtime
>>> $(find . -iname '*.h' -o -iname '*.c' -o -iname '*.hpp' -o -iname
>>> '*.cpp' -o -iname '*.cc')
>>
>> David, what do you think of the above to enforce an uniform coding
>> style for the multi-language bindings code (bindings.git)? Apart from
>> enforcing the GNU Coding Standards
>> (http://www.gnu.org/prep/standards/standards.html) it replaces TABs
>> with blankspaces, indents the pre-processor directives within
>> #ifdef...#endif blocks, and preserves the file access and modification
>> times.
>>
>> To avoid the current confusion in the parted.git code it would be
>> better if we decided this before committing anything to bindings.git.
>
> I like it.
>
> If it's something you plan to run regularly, you can
> make it more compact and a little more robust, e.g.
> when names contain shell meta-characters:
>
> find . \( -iname '*.[ch]' -o -iname '*.[ch]pp' -o -iname '*.cc' \) -print0 \
> | xargs -0 indent --gnu-style --no-tabs -ppi 2 --preserve-mtime
>
At least for C++ code it didn't work very well. It miss-indented the
class files and some other minor things. I'm now doing a look on bcpp
since I found some good references about it and I'd like to try it to
see how it does.
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: otavio at debian.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
you the whole house."
More information about the Parted-edge
mailing list