PyCQA / flake8

flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

Home Page:https://flake8.pycqa.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trailing slash breaks exclude and extend-exclude config

remisalmon opened this issue · comments

commented

how did you install flake8?

> pipx install flake8-bugbear --include-deps --force

unmodified output of flake8 --bug-report

{
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.11.8",
    "system": "Darwin"
  },
  "plugins": [
    {
      "plugin": "flake8-bugbear",
      "version": "24.2.6"
    },
    {
      "plugin": "mccabe",
      "version": "0.7.0"
    },
    {
      "plugin": "pycodestyle",
      "version": "2.11.1"
    },
    {
      "plugin": "pyflakes",
      "version": "3.2.0"
    }
  ],
  "version": "7.0.0"
}

describe the problem

Folders with trailing slashes in the exclude or extend-exclude in ~/.flake8 are ignored:

> cat ~/.flake8
[flake8]
exclude = Bug/
> flake8 --config ~/.flake8 .
./Bug/test.py:3:1: B001 Do not use bare `except:`, it also catches unexpected events like memory errors, interrupts, system exit, and so on.  Prefer excepting specific exceptions  If you're sure what you're doing, be explicit andwrite `except BaseException:`.
./Bug/test.py:3:1: E722 do not use bare 'except'
> flake8 --exclude Bug/ .
>

I think this is the exact same issue as #738 that is 3 years old?

~/.flake8 is not a supported flake8 configuration