Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #69856 > unrolled thread

Re: change spacing to two instead of four with pep8 or flake8?

Started byPeter Otten <__peter__@web.de>
First post2014-04-08 14:55 +0200
Last post2014-04-08 16:06 +0200
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: change spacing to two instead of four with pep8 or flake8? Peter Otten <__peter__@web.de> - 2014-04-08 14:55 +0200
    Re: change spacing to two instead of four with pep8 or flake8? Roy Smith <roy@panix.com> - 2014-04-08 09:20 -0400
      Re: change spacing to two instead of four with pep8 or flake8? Peter Otten <__peter__@web.de> - 2014-04-08 16:06 +0200

#69856 — Re: change spacing to two instead of four with pep8 or flake8?

FromPeter Otten <__peter__@web.de>
Date2014-04-08 14:55 +0200
SubjectRe: change spacing to two instead of four with pep8 or flake8?
Message-ID<mailman.9010.1396961763.18130.python-list@python.org>
Dennis wrote:

> In Pylint you can change the spacing multiplier from 4 spaces to two
> in its pylintrc, but for the life of me I cannot find a way to do this
> with the flake8 / pep8 utilities.
> 
> I want to avoid ignoring E111 altogether if at all possible, because
> it may catch other spacing problems that are not as obvious.
> 
> hacky/non-hacky solutions welcome of course.

The check is hardcoded

    if indent_char == ' ' and indent_level % 4:
        yield 0, "E111 indentation is not a multiple of four"

so your only short-term solution is to modify the script's source code.

[toc] | [next] | [standalone]


#69859

FromRoy Smith <roy@panix.com>
Date2014-04-08 09:20 -0400
Message-ID<roy-1740F4.09202908042014@news.panix.com>
In reply to#69856
In article <mailman.9010.1396961763.18130.python-list@python.org>,
 Peter Otten <__peter__@web.de> wrote:

> Dennis wrote:
> 
> > In Pylint you can change the spacing multiplier from 4 spaces to two
> > in its pylintrc, but for the life of me I cannot find a way to do this
> > with the flake8 / pep8 utilities.
> > 
> > I want to avoid ignoring E111 altogether if at all possible, because
> > it may catch other spacing problems that are not as obvious.
> > 
> > hacky/non-hacky solutions welcome of course.
> 
> The check is hardcoded
> 
>     if indent_char == ' ' and indent_level % 4:
>         yield 0, "E111 indentation is not a multiple of four"
> 
> so your only short-term solution is to modify the script's source code.

There's always monkey-patching :-)

[toc] | [prev] | [next] | [standalone]


#69866

FromPeter Otten <__peter__@web.de>
Date2014-04-08 16:06 +0200
Message-ID<mailman.9014.1396966019.18130.python-list@python.org>
In reply to#69859
Roy Smith wrote:

> In article <mailman.9010.1396961763.18130.python-list@python.org>,
>  Peter Otten <__peter__@web.de> wrote:
> 
>> Dennis wrote:
>> 
>> > In Pylint you can change the spacing multiplier from 4 spaces to two
>> > in its pylintrc, but for the life of me I cannot find a way to do this
>> > with the flake8 / pep8 utilities.
>> > 
>> > I want to avoid ignoring E111 altogether if at all possible, because
>> > it may catch other spacing problems that are not as obvious.
>> > 
>> > hacky/non-hacky solutions welcome of course.
>> 
>> The check is hardcoded
>> 
>>     if indent_char == ' ' and indent_level % 4:
>>         yield 0, "E111 indentation is not a multiple of four"
>> 
>> so your only short-term solution is to modify the script's source code.
> 
> There's always monkey-patching :-)

There is always a way to achieve roughly the same that takes more time and 
is slightly harder to get right ;)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web