<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 8:02 AM, ChangBo Guo <span dir="ltr"><<a href="mailto:glongwave@gmail.com" target="_blank">glongwave@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"><div>Hi Stackers,</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">I find some common code style would be avoided while I'm reviewing code ,so think these check would</span></div>
<div><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">be nice to move into local hacking. </span><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">The local hacking can ease reviewer burden.</span></div>
<p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">The idea from keystone blueprint [1]. <br>
Hacking is a great start at automating checks for common style issues. There are still lots of things that it is not checking for that it probably should. The local hacking ease reviewer burden . This is the list of from [1][2] that would be nice to move into an automated check:</p>
</div></blockquote><div><br></div><div>Can you go into why its worth enforcing each of these?</div><div><br></div><div>As a rule of thumb I prefer to add checks to hacking when relevant to all projects instead of each project re-inventing a local hacking rule.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">- use import style 'from openstack.common.* import' not use 'import openstack.common.*'<br>
- assertIsNone should be used when using None with assertEqual<br>- _() should not be used in debug log statements<br>-do not use 'assertTrue(isinstance(a, b)) sentence'<br>-do not use 'assertEqual(type(A), B) sentence'<span style="font-family:arial;font-size:small;line-height:normal;color:rgb(34,34,34)"> </span></p>
</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">[1] <a rel="nofollow" href="https://blueprints.launchpad.net/keystone/+spec/more-code-style-automation" style="color:rgb(0,51,170);text-decoration:none" target="_blank">https://blueprints.launchpad.net/keystone/+spec/more-code-style-automation</a><br>
[2] <a rel="nofollow" href="https://github.com/openstack/nova/blob/master/nova/hacking/checks.py" style="color:rgb(0,51,170);text-decoration:none" target="_blank">https://github.com/openstack/nova/blob/master/nova/hacking/checks.py</a></p>
<p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em;color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">I just registered a blueprint for this in [3] and submit first patch in [4].</p>
<p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em"><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">[3] <a href="https://blueprints.launchpad.net/oslo/+spec/oslo-local-hacking" target="_blank">https://blueprints.launchpad.net/oslo/+spec/oslo-local-hacking</a></span></p>
<p style="margin:0px 0px 1.2em;padding:0px;width:auto;max-width:45em"><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:12px;line-height:18px">[4] </span><a rel="nofollow" href="https://github.com/openstack/nova/blob/master/nova/hacking/checks.py" style="color:rgb(0,51,170);font-family:sans-serif;font-size:12px;line-height:18px;text-decoration:none" target="_blank">https://review.openstack.org/#/c/87832/</a></p>
Should we add local hacking for oslo-incubator ? If yes, what's the other check will be added ?<div>Your comment is appreciated :-)<span class="HOEnZb"><font color="#888888"><br clear="all"><div><div><br>-- <br><div dir="ltr">
<div>ChangBo Guo(gcb)</div>
</div>
</div></div></font></span></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div>