Discussion:
[OpenAFS-devel] Coding Style Guide
Pat Riehecky
2018-05-24 15:51:41 UTC
Permalink
I was looking over https://wiki.openafs.org/devel/CodingStyle/ and
wondered if it might be worth considering basing the OpenAFS style on
one of these:


https://llvm.org/docs/CodingStandards.html
https://google.github.io/styleguide/cppguide.html
https://www.chromium.org/developers/coding-style
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style


clang-format lets you make a custom based off of these.  In theory this
could allow regular runs of clang-format to fix style errors (or maybe a
gerrit hook similar to buildbot?) without having quite so many warnings
on the development site.

The git settings from https://wiki.openafs.org/devel/GitDevelopers/ are
great, but a tool you can automate might lower the intimidation factor a
bit.

Pat
--
Pat Riehecky

Fermi National Accelerator Laboratory
www.fnal.gov
www.scientificlinux.org
Michael Meffie
2018-05-29 14:32:56 UTC
Permalink
On Thu, 24 May 2018 10:51:41 -0500
Post by Pat Riehecky
I was looking over https://wiki.openafs.org/devel/CodingStyle/ and
wondered if it might be worth considering basing the OpenAFS style on
https://llvm.org/docs/CodingStandards.html
https://google.github.io/styleguide/cppguide.html
https://www.chromium.org/developers/coding-style
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style
clang-format lets you make a custom based off of these.  In theory this
could allow regular runs of clang-format to fix style errors (or maybe a
gerrit hook similar to buildbot?) without having quite so many warnings
on the development site.
The git settings from https://wiki.openafs.org/devel/GitDevelopers/ are
great, but a tool you can automate might lower the intimidation factor a
bit.
Unfortunately, I don't think it would be practical to impose a new coding style
on a large, legacy code base. It is difficult since there is a wide variation
of coding styles depending on the subsystem/module. For the most part, I try
to be consistent with the local coding style and lean on gnu indent with
the given .indent profile shown on the openafs wiki, since that was used to
reformat the tree at one point.

Best regards,
Mike
--
Michael Meffie <***@sinenomine.net>
Loading...