[cfe-dev] Integrating clang-based refactoring tools into IDEs - best practices?

Richard legalize at xmission.com
Mon Jun 1 10:56:02 PDT 2015

In article <CAOsfVvnRwj36LrGnCRv4y7hi9S+ioEzyJNxaEc=aM-WmLNDrHA at mail.gmail.com>,
    Manuel Klimek <klimek at google.com> writes:

> On Mon, Jun 1, 2015 at 6:27 PM Richard <legalize at xmission.com> wrote:

> > Every time I've asked about where to put refactoring tools, I'm always
> > told "clang-tidy",
> I'd fine that very curious... (when I say refactoring I usually mean
> "Fowler-style")

Ah, so you're thinking of very general refactorings like Extract
Method, Inline Method, etc.  Over the years I've written up some
refactorings in Fowler style that are specific to C/C++:

The refactorings I've been doing in clang-tidy are maybe what you
would call "micro refactorings":

if (b == true) => if (b)

...and yet, these sorts of things are *very* useful from an IDE.  Yes,
you can run clang-tidy and mark these as "fixups" that are available
by applying the suggested patch from clang-tidy, but both the micro
refactorings and the Fowler style ones seem like they'd be better off
in a library that was invoked in a shorter turnaround cycle from an
IDE.  Do you agree?

clang-tidy is batch oriented.  IDEs are interactive.
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>

PS: Mail filters are blocking my messages, so ignore this, its
only for them.  Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Phasellus consequat ullamcorper mollis. Sed blandit semper tortor
ultricies dictum. Proin hendrerit et quam in sagittis. Maecenas vel
blandit ante, in auctor sem.  Phasellus condimentum leo vel finibus
viverra. Duis fermentum sollicitudin est, ac iaculis lectus auctor vel.
Nam condimentum nulla feugiat, venenatis nibh a, elementum nulla. Nulla
vitae malesuada eros. Nulla cursus maximus ligula non hendrerit.

Curabitur lobortis nulla vel sapien posuere, id aliquam orci
bibendum. Vestibulum at vulputate risus. Proin in purus commodo,
tempus lectus vitae, faucibus nunc. Aenean congue faucibus elit, sit
amet facilisis nibh ultrices eget. Nam pulvinar leo ac nunc ultricies,
nec tincidunt nulla tincidunt. Etiam placerat felis tellus, ut ultricies
nunc ultricies quis. In placerat sapien nec ultricies mattis. Integer
sed tempor orci, ac imperdiet orci. Integer ac augue et augue convallis

More information about the cfe-dev mailing list