darioteixeira / lambdoc

Lambdoc is a library providing support for semantically complex documents in Ocsigen web applications
GNU General Public License v2.0
17 stars 1 forks source link

Tab vs Space indentation #10

Closed Drup closed 9 years ago

Drup commented 9 years ago

I know it may be an annoying remark, but, can the codebase switch to spaces please ?

Most OCaml codebases I have encountered are using spaces and now that ocp-indent is around, you can customize your indention on a project basis by putting a .ocp-indent at the root of your project.

Editing your tab-indented code is very annoying for several reasons:

I'm not a fervent defender of spaces for indentation (as opposed to alignment) but in the case of OCaml, considering the ecosystem and the tooling, I don't see any reasons to stick to tabs.

darioteixeira commented 9 years ago

Yeah, that's a fair point, and I'm aware that my conventions are somewhat heterodox... The thing is that I prefer having ample horizontal separation for indentation, and I find 2-space indents way too short. However, I think I could settle for 4-space indentation. I'll have to check out ocp-indent and see how easy/convenient it is to get VIM to play nice with more mainstream OCaml conventions...

Drup commented 9 years ago

Thanks ! You'll see it's quite easy to parametrize to your needs.

darioteixeira commented 9 years ago

Hey @drup, I've just committed 7d51df9, which should have taken care of this issue.

I've opted for 4-space indentation. 2 spaces seems more common in the OCaml community, but I find it too small to gauge nesting comfortably. In any case, the more important thing is that the TAB character has been replaced with actual spaces.

Drup commented 9 years ago

Can you add the .ocp-indent at the root of the repository with your preferences ?

darioteixeira commented 9 years ago

Can you add the .ocp-indent at the root of the repository with your preferences ?

Done! Though I couldn't manage to get ocp-indent to behave exactly as I wanted, and some manual tweaks were still required (nothing big, though).