[GRASS-dev] Python: fixing mixed tabs and spaces

Markus Neteler neteler at osgeo.org
Fri Nov 30 13:46:17 PST 2018


On Fri, Nov 30, 2018 at 10:04 PM Markus Neteler <neteler at osgeo.org> wrote:
>
> Hi devs,
>
> in several Python scripts tabs and spaces are mixed which is a problem.
>
> Questions:
> - how to find these problems: with pylint, recursively?

Here an (overly) simple approach:

for i in $(ag --python -l) ; do pylint-3 --errors-only $i | grep
'inconsistent use of tabs and spaces in indentation' && echo $i ; done
E:161, 0: inconsistent use of tabs and spaces in indentation
(<string>, line 161) (syntax-error)
scripts/v.rast.stats/v.rast.stats.py
E: 40, 0: inconsistent use of tabs and spaces in indentation
(<string>, line 40) (syntax-error)
raster/r.reclass/testsuite/test_r_reclass.py

(the first has just been fixed by Anna)

> - how to avoid them? Perhaps we collect the respective editor settings
> in a Wiki page?

Markus


More information about the grass-dev mailing list