john-hen / Flake8-pyproject

Flake8 plug-in loading the configuration from pyproject.toml
https://pypi.org/project/Flake8-pyproject
MIT License
218 stars 10 forks source link

`flake8p` is only aware of `pyproject.toml` in the current folder #7

Closed john-hen closed 2 years ago

john-hen commented 2 years ago

As I've noticed today, when running flake8p in a folder below the main project folder, it does not pull the configuration from pyproject.toml (then in a folder or more above). This used to work before, so is due to the refactoring in Flake8 version 5 and the new "hook" tailored to that. Mea culpa. This should be fixed, somehow.

As of now, flake8p only works as expected when run from the folder that contains pyproject.toml. The existing test cases all assume that simple folder structure, so a test case should be added that tests running from a subfolder.

john-hen commented 2 years ago

On second thought, I'm actually fine with this behavior. That's what Mypy does, and Pylint as well. And pyTest we'd also typically run from the project folder. CI workflows are always set up that way. And it makes sense that when we configure a tool for a specific project in pyproject.toml, we would run that tool in that very project folder.

So I won't fix this, as it keeps things simple and wouldn't add much otherwise. Yes, it's different from what Flake8 does, but then Flake8 does not support pyproject.toml. 🤷