[cfe-dev] clang-format and "ASCII art" formatting

Manuel Klimek klimek at google.com
Fri Dec 7 09:49:39 PST 2012


On Fri, Dec 7, 2012 at 6:40 PM, Nico Weber <thakis at chromium.org> wrote:

> On Fri, Dec 7, 2012 at 8:18 AM, Daniel Jasper <djasper at google.com> wrote:
> > Hi all,
> >
> > although I think we can make clang-format (clang/lib/Format) format more
> and
> > more pieces of C++ according to a specific style, I am convinced that
> there
> > are cases where automatic formatting is not the right solution.
> >
> > An example is:
> > http://clang.llvm.org/doxygen/ParseExpr_8cpp-source.html line 60-90.
> Here,
> > careful human thought leads to much more readable code then simply
> following
> > a style guide.
> >
> > In order to handle such cases and still be able to auto-format entire
> files,
> > I propose to add certain markers around areas of a file that clang-format
> > should not touch.
>
> In my opinion, the main advantage of an autoformatter is that its
> output can be declared as canonical and that in organizations that do
> that nobody needs to argue about indentation anymore. If you provide a
> formatting escape hatch, you lose that property.
>

This feature would not benefit organizations as much as it might benefit
small open source projects.

Cheers,
/Manuel

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121207/f412b55f/attachment.html>


More information about the cfe-dev mailing list