<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 9:35 AM, Alexis Lee <span dir="ltr"><<a href="mailto:alexisl@hp.com" target="_blank">alexisl@hp.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">As a new OpenStack contributor, +1 for lower barriers to entry. It's<br>


helpful for OS to inform editor style and I don't believe in the<br>
arguments to remove them.<br>
<br>
> Why remove them?<br>
<div class="im">> * we could shrink our codebase by a little bit.<br>
<br>
</div>Why do you want to shrink it? Simplify, sure, but modelines are not<br>
code (not Python anyway). Even so, it's only one line per file.<br>
<div class="im"><br>
> * Modelines aren't supported by default in debian or ubuntu due to<br>
> security reasons: <a href="https://wiki.python.org/moin/Vim" target="_blank">https://wiki.python.org/moin/Vim</a><br>
<br>
</div>As I believe with many Vim users, my .vimrc greatly predates my<br>
involvement with OpenStack and it reflects my personal preferences (like<br>
Termie's). I really wouldn't rely on the defaults surviving initial user<br>
contact.<br>
<div class="im"><br>
> * Having modelines for vim means if someone wants we should support<br>
> modelines for emacs<br>
> (<a href="http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Specifying-File-Variables" target="_blank">http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Specifying-File-Variables</a>)<br>
<br>
</div>I don't see a problem supporting Emacs, as the other major UNIX editor.<br>
The slippery slope runs dry very quickly after that, I don't see gedit<br>
users petitioning for inclusion (no offense intended to any gedit<br>
devotees!).<br>
<br>
Alternatively Emacs users as self-proclaimed users of the bestest editor<br>
ever could just install: <a href="https://github.com/cinsk/emacs-vim-modeline" target="_blank">https://github.com/cinsk/emacs-vim-modeline</a><br>
and brag about how flexible their editor is. </blockquote><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 class="im"><br>
> * There are other ways of making sure tabstop is set correctly for<br>
> python files, see  <a href="https://wiki.python.org/moin/Vim" target="_blank">https://wiki.python.org/moin/Vim</a>.  I am a vIm user<br>
> myself and have never used modelines.<br>
<br>
</div>I am a Vim user and frequently use modelines! I like that they 'stick'<br>
to files so even if a file gets separated from its project, the modeline<br>
remains.<br></blockquote><div><br></div><div>From an OpenStack point of view, that is not an issue.  If a file gets separated then why should we worry about if it has a pep8 friendly tabstop?</div><div> </div><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">


<br>
If I wanted to work on a project with style contrary to OpenStack's, I'd<br>
need to write project-specific autocommands. It feels right to me that<br>
if a project requires specific style, it should gate it (as OS does) and<br>
provide some informative help as well (the modelines).<br></blockquote><div><br></div><div>We don't just gate without telling people, the first two items in hacking are read pep8</div><div><br></div><div><a href="http://docs.openstack.org/developer/hacking/">http://docs.openstack.org/developer/hacking/</a></div>

<div> </div><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">
<br>
OS could provide a vim script to set up project-specific style but this<br>
fails the barrier-to-entry test.<br>
<div class="im"><br>
> * We have vim modelines in only 828 out of 1213 python files in nova<br>
> (68%), so if anyone is using modelines today, then it only works 68% of<br>
> the time in nova<br>
<br>
</div>Then we should fix that, in accordance with OS style guidelines.<br>
It's also possible those are the high-touch files?<br></blockquote><div><br></div><div>As of writing this email we don't OS style guidelines (hacking) don't require vim modelines.  This thread is trying to resolve this. </div>

<div> </div><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 class="im"><br>
> * Why have the same config 828 times for one repo alone?  This<br>
> violates the DRY principle (Don't Repeat Yourself).<br>
<br>
</div>Because afaik there's no standard way to inform editors of<br>
project-specific style guidelines. Plus previously mentioned benefit of<br>
stickiness.<br></blockquote><div><br></div><div>PEP8 is hardly project specific.</div><div><br></div><div> </div><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">


<br>
<br>
John Dennis said on Fri, Oct 25, 2013 at 04:12:35PM -0400:<br>
> Emacs... requires the per file variables to be the 1st line . So don't<br>
<div class="im">> see how vim and emacs specifications will coexist nicely and stay that<br>
> way consistently.<br>
<br>
</div>What's the problem? Vim has no such limitation, Emacs can have 1st line<br>
+ Vim 2nd.<br>
<div class="im"><br>
> My personal feeling is you need to have enough awareness to configure<br>
> your editor correctly to contribute to a project. It's your<br>
> responsibility and our gate tools will hold you to that promise.<br>
<br>
</div>That's not very welcoming. If a project want to be particular about<br>
its style, it has a responsibilty to not just gate but also assist in<br>
following that style.<br></blockquote><div><br></div><div>We do try to make it easy to follow the style. Its fully documented here  <a href="http://docs.openstack.org/developer/hacking/">http://docs.openstack.org/developer/hacking/</a>.  Also the modeline we use is hardly enough to follow the style (80 char limit, spacing between functions, between classes etc.) And we provide several ways for a user to run the full set of style tests locally. </div>

<div><br></div><div>* Install hacking locally (pip install hacking), and run 'flake8' - which has a really nice vim plugin too  (<a href="https://github.com/nvie/vim-flake8">https://github.com/nvie/vim-flake8</a>)</div>

<div>* Just run 'tox -epep8'</div><div><br></div><div><br></div><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">


<br>
I should mention that not long ago I spent a good half day reading<br>
OpenStack materials on "this is how things must be done", too long imho.<br>
<div class="im"><br>
> Let's just remove the mode lines, they really don't belong in every file.<br>
<br>
</div>Let's just leave them. It's a big change, some people like them and the<br>
benefits of removal are minimal at best.<br>
<span class=""><font color="#888888"><br>
<br>
Alexis<br>
--<br>
Nova Engineer, HP Cloud.  AKA lealexis, lxsli.<br>
</font></span><div class=""><div class="h5"><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>
</div></div></blockquote></div><br></div></div>