Consolidate flake8 configuration into pyproject.toml#9957
Consolidate flake8 configuration into pyproject.toml#9957p-r-a-v-i-n wants to merge 1 commit intoencode:mainfrom
Conversation
| hooks: | ||
| - id: flake8 | ||
| additional_dependencies: | ||
| - flake8-pyproject |
There was a problem hiding this comment.
i don't know if we are ok with adding this ( flake8-pyproject ) extra dependency in pre-commit which requires here to load flake8 config from pyproject.toml
There was a problem hiding this comment.
Pull request overview
This PR centralizes the repository’s Flake8 configuration by moving it from setup.cfg into pyproject.toml, aligning Flake8 with the other tool configurations already managed there.
Changes:
- Removed the legacy
setup.cfgthat only contained Flake8 settings. - Added a
[tool.flake8]section topyproject.tomlwith the prior settings. - Updated the pre-commit Flake8 hook to install
flake8-pyprojectso Flake8 can readpyproject.toml.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| setup.cfg | Removes legacy Flake8-only config file. |
| pyproject.toml | Adds centralized [tool.flake8] configuration. |
| .pre-commit-config.yaml | Ensures pre-commit Flake8 can load config from pyproject.toml via flake8-pyproject. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'm a bit on the fence here. While I can see the appeal to consolidate everything, I'm a bit worried on how this package hooks into flake8: is it using an officially supported API or is it using an undocumented one? I'm trying to assess if/when it stop working due to a breaking change in flake8, would it stop using the config or would it crash? |
|
Your point has merit here and IMO we shouldn't proceed further without confidence. |
Currently we configuration for other tools in
pyproject.tomlbut forflak8we are maintaining seperate file.my moving
flake8config inpyproject.tomlkeeps project configuration centralized inpyproject.tomlChanges:
flake8settings fromsetup.cfgto[tool.flake8]inpyproject.tomlflake8hook to includeflake8-pyprojectsetup.cfg