<div dir="ltr">Hello,<div><br></div><div>Thank you for the answer.</div><div><br></div><div>It was my first guess and I was surprised that it did not work.</div><div><br></div><div>I have to use '-export-fixes=' so it works. Then the fixes are written into json file and 'clang-apply-replacements -format -style=file' does the job.</div><div>But it does want to work without this exporting.</div><div><br></div><div>In version 5.0 I just use option '-format-style=file' and it uses .clang-format file in the closest parent directory as described in the documentation:</div><div><a href="https://clang.llvm.org/extra/clang-tidy/index.html">https://clang.llvm.org/extra/clang-tidy/index.html</a><br></div><div><br></div><div>But in version 4.0 there is only option "-style" which seems to not offer such option and does not work with .clang-format from the folder I run clang-tidy.</div><div><br></div><div><pre style="overflow-x:auto;overflow-y:hidden;border-color:rgb(12,55,98);border-style:dotted;border-width:thin;margin-top:0px;margin-bottom:12px;padding:0.8em;background-color:rgb(240,240,240);color:rgb(51,51,51)"><span class="gmail-go" style="color:rgb(136,136,136)">-style=<string>              -</span>
<span class="gmail-go" style="color:rgb(136,136,136)">                                 Fallback style for reformatting after inserting fixes</span>
<span class="gmail-go" style="color:rgb(136,136,136)">                                 if there is no clang-format config file found.</span></pre></div><div><br></div><div>I am not sure why it it like that.</div><div><br></div><div>Best regards,</div><div>Adam.</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 20, 2017 at 11:18 PM, Piotr Padlewski <span dir="ltr"><<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Adam,<div>it should look for ".clang-format" from the place where you run clang-tidy. I hope it helps.</div><div><br></div><div>Piotr</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2017-07-20 13:25 GMT-07:00 Adam Cieszkiel via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div style="font-size:12.8px">Hello,</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I have a question:</div><div style="font-size:12.8px">Do you know maybe how to make clang-tidy in version 4.0 use formatting style for fixes (-fix) from .clang-format file?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I tried in many different ways but I failed.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Documentation mentions 'clang-format config file to be found' but anywhere I put it, it is still not used by clang-tidy also if I put in in location pointed by '-p' option.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><a href="http://releases.llvm.org/4.0.0/tools/clang/tools/extra/docs/clang-tidy/index.html" target="_blank">http://releases.llvm.org/4.0.0<wbr>/tools/clang/tools/extra/docs/<wbr>clang-tidy/index.html</a><br></div><div style="font-size:12.8px"><pre style="white-space:pre-wrap;overflow-x:auto;overflow-y:hidden;border-color:rgb(12,55,98);border-style:dotted;border-width:thin;margin-top:0px;margin-bottom:12px;padding:0.8em;background-color:rgb(240,240,240);color:rgb(51,51,51)"><span class="m_-2240981996741135818m_-4401292906132140214gmail-m_-3350798067441497022gmail-go" style="color:rgb(136,136,136)">-style=<string>              -</span>
<span class="m_-2240981996741135818m_-4401292906132140214gmail-m_-3350798067441497022gmail-go" style="color:rgb(136,136,136)">                                 Fallback style for reformatting after inserting fixes</span>
<span class="m_-2240981996741135818m_-4401292906132140214gmail-m_-3350798067441497022gmail-go" style="color:rgb(136,136,136)">                                 if there is no clang-format config file found.</span></pre></div><div style="font-size:12.8px">I have no idea where I should put .clang-format file so it could be used by clang-tidy for applying clang-tidy fixes.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thank you in advance.</div></div>
<br></div></div>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>