<p dir="ltr">The reason to make it a shell script it's that it needs almost no logic, it's just a shortcut for a couple of commands. The hard part here was incompatibility of sed on different platforms. If this script was written in Python, there would also be a chance of hitting compatibility issues between Python versions (as it was with tests for clang-tidy-diff.py, it uses argparse which is available only in python 2.7+).</p>
<p dir="ltr">But if someone can suggest a significantly better alternative to this script, which is compatible with all configurations supported by llvm, I won't object.</p>
<div class="gmail_quote">On 8 Aug 2014 20:00, "Rui Ueyama" <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I don't see any reason why it's a shell script and not written in Python. After the 5 commits to try to fix sed invocation Python seems obviously better than the shell.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Aug 8, 2014 at 9:44 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</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"><div class="gmail_extra"><div class="gmail_quote"><div><div>On Fri, Aug 8, 2014 at 2:00 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.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"><div class="gmail_extra"><div class="gmail_quote"><div><div>On Fri, Aug 8, 2014 at 10:34 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
On Thu, Aug 7, 2014 at 11:49 PM, Benjamin Kramer <span dir="ltr"><<a href="mailto:benny.kra@googlemail.com" target="_blank">benny.kra@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">...<div><br>
--- clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh (original)<br>
+++ clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh Thu Aug 7 16:49:38 2014<br>
@@ -20,7 +20,7 @@ set -o errexit<br>
# Remove the contents of the CHECK lines to avoid CHECKs matching on themselves.<br>
# We need to keep the comments to preserve line numbers while avoiding empty<br>
# lines which could potentially trigger formatting-related checks.<br>
-sed 's#// *[A-Z-]\+:.*#//#' ${INPUT_FILE} > ${TEMPORARY_FILE}<br>
+sed -E 's#// *[A-Z-]+:.*#//#' ${INPUT_FILE} > ${TEMPORARY_FILE}<br></div></blockquote><div><br></div><div>The check is awesome, but the idea to improve sed invocation turned out to be not very nice: r215163, r215171, r215175, and finally back to what it was: r215189. Let's leave it as is ;)</div>
</div></div></div></blockquote><div><br></div></div></div><div>I was also wrong trying to change sed invocation after Rui's last attempt, which actually worked both on Linux and Darwin, hence r215192.</div><div><br></div>
<div>Compatibility is hard =/</div></div></div></div></blockquote><div><br></div></div></div><div>Any reason this is a shell script, not a python script?</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
</div>
</div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div></div><br></div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div>