[GRASS-dev] [GRASS GIS] #1832: Python scripts are with mixed tabs and spaces

GRASS GIS trac at osgeo.org
Tue Dec 11 23:25:36 PST 2012


#1832: Python scripts are with mixed tabs and spaces
-------------------------+--------------------------------------------------
 Reporter:  klo          |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  6.4.3                    
Component:  Python       |     Version:  unspecified              
 Keywords:               |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by zarch):

 Replying to [comment:4 wenzeslaus]:
 > Moreover, the problem of white spaces in GRASS Python code is larger.
 > Try to use pep8 tool, the result is really bad. I think that if there
 > is some standard, we should keep it, at least the basic rules.

 +1


 > I understand the problem of editor settings. I encountered it, too.
 However,
 > I also know the opposite problem. My Python editor is confused and
 complains
 > about GRASS code and thus it is sometimes hard to use editor's code
 checking
 > features.

 +1

 why not use a pre-commit check, using pep8 like:

 https://gist.github.com/2903822  # pep8 + pyflakes
 http://widerin.org/blog/pep8-subversion-pre-commit-hook  # only pep8

 to force developers to use a standard?

 Using a standard can help to have a consistent python code and make the
 code easier to read.

 Pietro

 ps: pep8 command could be use also to convert all the existing python code
 to comply the pep8 directive...

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1832#comment:5>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list