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

Manuel Klimek klimek at google.com
Tue Jun 2 01:09:52 PDT 2015


On Mon, Jun 1, 2015 at 10:33 PM Maurizio Vitale <mrz.vtl at gmail.com> wrote:

> I'm curious. How is the integration of clang-tidy with the review tool
> working?
> Something that is run automatically before the reviewer even sees the code
> or something that is run on-demand, suggestion-by-suggestion?
>
Do the clang-tidy changes stay in the same CL or are separate CLs generated
> and submitted automatically?
>

More details than you will probably want, but hey, you asked :D
http://static.googleusercontent.com/media/research.google.com/en/us/pubs/archive/43322.pdf



> On Mon, Jun 1, 2015 at 1:12 PM, Manuel Klimek <klimek at google.com> wrote:
>
>>
>>
>> On Mon, Jun 1, 2015 at 8:07 PM Richard <legalize at xmission.com> wrote:
>>
>>>
>>> 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++:
>>> <https://legalizeadulthood.wordpress.com/category/refactoring/
>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__legalizeadulthood.wordpress.com_category_refactoring_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=0Aqmt4AH6fT1R98xw1DFyNhyN4TbNZkVFiEc9z26_zY&s=xrC7INDHvbYUKu2ghJ5Uzn-tmbZkcqZZTGnvtKj9BUU&e=>
>>> >
>>>
>>> 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.
>>>
>>
>> I think that's not true in general. clang-tidy, the command line tool, in
>> its current form is batch oriented. I don't think there's a generic
>> limitation to integrate clang-tidy into IDEs (we integrate it into our code
>> review tool for example).
>>
>>
>>> --
>>> "The Direct3D Graphics Pipeline" free book <
>>> http://tinyurl.com/d3d-pipeline
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__tinyurl.com_d3d-2Dpipeline&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=0Aqmt4AH6fT1R98xw1DFyNhyN4TbNZkVFiEc9z26_zY&s=JU4oGCGhiKe1jFZKJIOte705YG5LnMhtEuplNX1THFc&e=>
>>> >
>>>      The Computer Graphics Museum <http://ComputerGraphicsMuseum.org
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__ComputerGraphicsMuseum.org&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=0Aqmt4AH6fT1R98xw1DFyNhyN4TbNZkVFiEc9z26_zY&s=SUHZpjFFxwkM8js7iceVn7dlBUsOi1KR39_6sQZLgjU&e=>
>>> >
>>>          The Terminals Wiki <http://terminals.classiccmp.org
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__terminals.classiccmp.org&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=0Aqmt4AH6fT1R98xw1DFyNhyN4TbNZkVFiEc9z26_zY&s=3OW391yJQ4XLd-fTuMl1G-tQF4AV1D9VjUsjsOP0kpk&e=>
>>> >
>>>   Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__LegalizeAdulthood.wordpress.com&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=0Aqmt4AH6fT1R98xw1DFyNhyN4TbNZkVFiEc9z26_zY&s=ifng5ZqQRnUA6ddnUTjHKKjh6sGadpoRzyA-RqlGDRU&e=>
>>> >
>>>
>>> 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
>>> faucibus.
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150602/36d08c09/attachment.html>


More information about the cfe-dev mailing list