Skip to content

Consolidate flake8 configuration into pyproject.toml#9957

Open
p-r-a-v-i-n wants to merge 1 commit intoencode:mainfrom
p-r-a-v-i-n:remove-setupcfg
Open

Consolidate flake8 configuration into pyproject.toml#9957
p-r-a-v-i-n wants to merge 1 commit intoencode:mainfrom
p-r-a-v-i-n:remove-setupcfg

Conversation

@p-r-a-v-i-n
Copy link
Copy Markdown
Contributor

Currently we configuration for other tools in pyproject.toml but for flak8 we are maintaining seperate file.
my moving flake8 config in pyproject.toml keeps project configuration centralized in pyproject.toml

Changes:

  • moved flake8 settings from setup.cfg to [tool.flake8] in pyproject.toml
  • updated pre-commit flake8 hook to include flake8-pyproject
  • removed legacy setup.cfg

Comment thread .pre-commit-config.yaml
hooks:
- id: flake8
additional_dependencies:
- flake8-pyproject
Copy link
Copy Markdown
Contributor Author

@p-r-a-v-i-n p-r-a-v-i-n Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cfg that only contained Flake8 settings.
  • Added a [tool.flake8] section to pyproject.toml with the prior settings.
  • Updated the pre-commit Flake8 hook to install flake8-pyproject so Flake8 can read pyproject.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants