How to write a pep8 configuration (pep8.rc) file?

后端 未结 3 1535
别那么骄傲
别那么骄傲 2021-02-01 05:05

I found the documentation for pep8 but wasn\'t able to understand how to write these. I couldn\'t even find any examples with options other than setting max-line-length and igno

3条回答
  •  名媛妹妹
    2021-02-01 05:17

    Sadly, the answer from Andy Hayden does not work for pytest / pytest-pep8 / flake8.

    pytest-pep8

    For that, you have to use either

    # content of setup.cfg
    [pytest]
    pep8maxlinelength = 99
    

    or

    [pytest]
    max-line-length=99
    

    Strangely, the following does not work

    [tool:pytest]
    max-line-length=99
    

    pytest-flake8

    Add

     [flake8]
     max-line-length=99
    

提交回复
热议问题