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

Anna Petrášová kratochanna at gmail.com
Sun Dec 2 19:09:23 PST 2018


On Fri, Nov 30, 2018 at 4:46 PM Markus Neteler <neteler at osgeo.org> wrote:

> 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)
>
>
Just a note, I found it when compiling with Python 3, that was the only one
which failed.

Anna


> - how to avoid them? Perhaps we collect the respective editor settings
> > in a Wiki page?
>
> Markus
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20181202/9f98a3d5/attachment.html>


More information about the grass-dev mailing list