swp-fu-eid / eid-fu-swp

Docker-based REST API implemented with Django and restframework.
MIT License
2 stars 1 forks source link

Code Style Policy #30

Closed nils-wisiol closed 7 years ago

nils-wisiol commented 7 years ago

Please use a common policy for coding style, including a policy on tabs vs spaces. Please use \n (unix) line breaks everywhere.

25 both adds a tab-indented file and changes existing files from tab indention to space indention. Please avoid whitespace-only changes and stick to one of tabs or spaces, preferably the one that is already used in the project.

m273d15 commented 7 years ago

I found a guideline from google: https://google.github.io/styleguide/pyguide.html There are multiple pyline configurations that configure this styleguide. @Armagetron mentioned that it would be useful to use a Django guideline, but i found only a prosaic specification without a full technical solution: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/

nils-wisiol commented 7 years ago

If you wanna go with that, no problem. For us it is sufficient to decide tabs/spaces and stick to unix newlines without a full-blown linter.

Also, PEP has some nice style advice.

m273d15 commented 7 years ago

Alright so we are using 4 spaces as tab and \n from unix! We will see whether a linter will be needed. Example vim config:

let spaces=4
execute "set tabstop=".spaces
execute "set softtabstop=".spaces
execute "set shiftwidth=".spaces
set expandtab
set smarttab
nils-wisiol commented 7 years ago

:+1: