m-lab / ansible-style-guide

This style guide is designed to ensure consistent style and practices across M-Lab's Ansible playbooks and associated Ansible files.
Apache License 2.0
1 stars 2 forks source link

Define: Include vim modelines for Ansible filetype? #7

Open mtlynch opened 8 years ago

mtlynch commented 8 years ago

For Vim users, having the following modeline near the top or bottom lets Vim know to treat the file as Ansible and use Ansible-specific Vim plugins:

# vim:ft=ansible:

Do we want to make this standard for all Ansible files? I believe Vim Ansible plugins have other ways of detecting file type such as:

pboothe commented 8 years ago

I would prefer not to favor one editor over another in the ansible files. Particularly when there are the other methods you noted. Specifying the formatting commands in vim or emacs or whatever may make sense, but requiring the modeline in the ansible files feels like the wrong choice.

(I am a vim user)

salarcon215 commented 8 years ago

I would be ok with the modeline, especially if adding something comparable for another editor would ease the concern. But that puts us on a road of fighting exclusive speech with ever more inclusive speech.

Therefore, if we choose to prioritize an editor-agnostic stance (probably the right choice for re-usability), then my second favorite choice is to use the parent folder option because inheritance is nice. That said, I'm usually wrong about this kind of thing and defer to others who have stronger experiential opinions.

nkinkade commented 8 years ago

I don't know that we necessarily need to require a vim modeline, but I don't see any harm in having one there. For developers who don't use vim, then it's just a one line comment. More interesting than syntax highlighting for me is specifying the indent level and wrapping... or is that just 4 and 80, respectively, for every language we use?