We follow the PEP-Standard quite close. Every python file has to follow these coding rules. There are some exceptions. We allow:
- variable names of length 1
You can use Pylint and the
pylint.rc in the PYMESS sources to check your code.
If you have GOOD reasons to not follow these rules, then you can deactivate
pylint for some code pieces
using special syntax:
# pylint: disable=line-too-long
Do not use this because you are too lazy to follow the PEP-Standard!
A useful tool is YAPF, we also have a stylefile
yapf.rc for this tool in
For friends of
vim, some settings:
Plugin 'scrooloose/syntastic' au FileType python setl colorcolumn=120 list et let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 1 let g:syntastic_python_checkers = ["pylint"] let g:syntastic_enable_balloons = 1 let g:syntastic_python_pylint_args = '--rcfile=/home/daniels/cmess/python/pylint.rc'
If you have pylint installed then you can use the target make pymess-lint to check the sources codes against our standards.
Avoid wild card imports
from pymess import * from scipy import * from numpy import * m = mmread("mymatrix.mtx") # Which module import imports mmread?
It is not clear if
mmread comes from