<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I agree with Wentao. The auto-formatting script should be triggered when you push a commit for code review. We cannot ask people to memorize all the coding style rules.<br class=""><div class=""><br class=""></div><div class="">Spyros</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Nov 3, 2016, at 11:06 AM, Wentao Shang <<a href="mailto:wentaoshang@ucla.edu" class="">wentaoshang@ucla.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Nov 3, 2016, at 11:47 AM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" class="">shijunxiao@email.arizona.edu</a>> wrote:<br class=""><br class="">Hi Nick<br class=""><br class="">I heard there are someone using clang-format, but I haven't heard anyone being able to create a clang-format configuration that ensures 100% compliance.<br class="">Thus, I still recommend developers to memorize all style rules and ensure compliance the moment you type it.<br class=""><br class="">I heard from a Google engineer that they use Eclipse to ensure Google code style compliance. I'm unsure whether it's possible with ndn-cxx rules.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Inside Google, the auto-formatting tool is integrated into all the source control tools and text editors. You can either do “git clang-format” before you push, or (more preferably) add a hook to your emacs/vim editor that formats the code automatically on save. As a lazy person, I highly recommend the second approach, provided that we can patch clang to support our formatting rules in ndn-cxx.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Wentao</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">ndnSIM has defined their rules in terms of a particular clang-format configuration, which could be a solution. However, relying on a tool as the rules is similar to defining a network protocol in terms of a specific implementation, which could cause inter-operability problems.<br class=""><br class="">Yours, Junxiao<br class="">From: Nick Gordon<br class="">Sent: ‎11/‎3/‎2016 11:36<br class="">To: Junxiao Shi<br class="">Subject: Code formatter/beautifier<br class=""><br class="">Junxiao,<br class=""><br class="">In an attempt to smooth out style issues, I intend to use a formatter.<span class="Apple-converted-space"> </span><br class="">It appears that there is a well-known program, "clang-format", that does<span class="Apple-converted-space"> </span><br class="">this. Do you have any system that you use to format your code that I<span class="Apple-converted-space"> </span><br class="">should know about?<br class=""><br class="">-Nick<br class=""></blockquote><br class=""></div></blockquote></div><br class=""></div></body></html>