Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing slash breaks exclude and extend-exclude config #1919

Closed
remisalmon opened this issue Feb 15, 2024 · 1 comment
Closed

Trailing slash breaks exclude and extend-exclude config #1919

remisalmon opened this issue Feb 15, 2024 · 1 comment

Comments

@remisalmon
Copy link

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?

@asottile
Copy link
Member

~/.flake8 is not a supported flake8 configuration

@PyCQA PyCQA locked as resolved and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants