Pycodestyle: Pycodestyle is not detecting W605 and W503

Created on 3 Jul 2020  路  4Comments  路  Source: PyCQA/pycodestyle

Hi community,

I introduced two wrong rules (W605 & W503) in the example below:

def method_one(self):
    """
    * if :math:`p_i + s_i \geq p_{min} + 2 * s_{min}` -> Warning zone
    * if :math:`p_i + s_i \geq p_{min} + 3 * s_{min}` -> Change detected

    """
    gross_wages = 0
    taxable_interest = 0
    income = (gross_wages
              + taxable_interest)
    return income

When I run flake8 against this code, pycodestyle reports only W605

tox.ini:

[flake8]

```bash
$ flake8 example.py
example.py:3:27: W605 invalid escape sequence '\g'
example.py:4:27: W605 invalid escape sequence '\g'

And when I add an exception for **W605** in the `tox.ini` file. pycodestyle reports **W503**.

`tox.ini`:

[flake8]
ignore=W605

```bash
$ flake8 example.py 
example.py:10:15: W503 line break before binary operator

Was it supposed to have both W503 and W605 in the first example?

My configuration:

  • Python 3.8.2
  • flake8 3.8.3

Most helpful comment

you want extend-ignore

All 4 comments

W503 is among the disabled by default rules

you want extend-ignore

(also, you should really not ignore W605, it will become a syntax error in a future version of python -- you _probably_ want to r prefix your string -- or use pyupgrade which'll fix it automatically for you)

Thanks @asottile for the clarification. I'll give pyupgrade a try!

Was this page helpful?
0 / 5 - 0 ratings