[LLVMdev] style guidelines

reed kotler rkotler at mips.com
Mon Jun 4 16:45:36 PDT 2012


I think I can adapt the script they  have to llvm style guidelines for C++.
There can be a configuration file so various checking can be optionally 
turned on/off.

I will write one for tablegen files.

What I'm thinking of is a scheme so that things can be configured on a 
per directory basis.

for example:

there could be a .style_check file in a directory and it provides the 
default

similarly:

.style_check.td  provides further specialization for .td files
.style_check.h   provides further specialization for .h files


this could also be configured in the makefiles.

but the idea is to make some style checkers for various file types.

initially .cpp/.h and .td.


On 06/04/2012 03:22 PM, Chandler Carruth wrote:
> On Mon, Jun 4, 2012 at 2:29 PM, reed kotler <rkotler at mips.com 
> <mailto:rkotler at mips.com>> wrote:
>
>     Probably this has come up before... but have we considered just
>     adopting
>     the Google style guidlines and maybe modifying it in some places?
>
>
> Despite working at Google, and having to cope with multiple different 
> styles in my day-to-day work as a consequence, I would not push for this.
>
> I think that we should focus on building some consistency of style and 
> formatting within the LLVM/Clang/... codebases rather than picking one 
> style or another. Frankly, I just don't care *what* the style is 
> nearly as much as I care that it is consistently applied.
>
> I'll add minor points:
>
> - I suspect LLVM/Clang/... have plenty of good reasons to deviate from 
> any existing style. We shouldn't constrain ourselves to external 
> guidelines at this point; these are large healthy projects.
>
> - We can fix any problems or inconsistencies with the style guidelines 
> if contributors can agree to what they are and what would be a 
> superior alternative.
>
>
> Finally:
>
>     They have a nice script for c++ which will check for many things.
>
>
> It is not a nice script. Trust me. I use it every day, and I hate it 
> with a burning, fiery passion. Read the python code. It is not nice, 
> it is terrible. It is an atrocity. It is everything that is bad about 
> trying to "parse" C++ with regular expressions and python hacks, built 
> up w/o any overarching design or cohesion over years.
>
> I await the day we can kill it off and use a real Clang-based tool 
> instead.
>
>
>     http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
>
>     http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
>     _______________________________________________
>     LLVM Developers mailing list
>     LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>     http://llvm.cs.uiuc.edu
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120604/73a10df3/attachment.html>


More information about the llvm-dev mailing list