You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if a user could define the hooks they want to use in a repo in pyproject.toml instead of .pre-commit-config.yaml.
The Core Idea
At the moment, in order to define which hooks are going to be used in a specific repo, one needs to define a .pre-commit-config.yaml file and define the hooks there.
Most python tools support defining their config in both their own unique configration file and in a project pyproject.toml file. For example:
You can define the mypy config in both a mypy.ini file and pyproject.toml
You can define the coverage config in both .coverage file and pyproject.toml
etc.
It would be nice if pre-commit could support this ability as well.
Proposed Solution
pre-commit will try to read config initially from .pre-commit.config..yaml. If this file is missing, it will search for a pyproject.toml. If this file exists, it will be read the config from a [tool.pre-commit] section.
In this way, the following .pre-commit-config.yaml file:
Uh oh!
There was an error while loading. Please reload this page.
search you tried in the issue tracker
pyproject, config
describe your actual problem
TL;DR
It would be nice if a user could define the hooks they want to use in a repo in
pyproject.toml
instead of.pre-commit-config.yaml
.The Core Idea
At the moment, in order to define which hooks are going to be used in a specific repo, one needs to define a
.pre-commit-config.yaml
file and define the hooks there.Most python tools support defining their config in both their own unique configration file and in a project
pyproject.toml
file. For example:mypy.ini
file andpyproject.toml
.coverage
file andpyproject.toml
It would be nice if pre-commit could support this ability as well.
Proposed Solution
pre-commit will try to read config initially from
.pre-commit.config..yaml
. If this file is missing, it will search for apyproject.toml
. If this file exists, it will be read the config from a[tool.pre-commit]
section.In this way, the following
.pre-commit-config.yaml
file:Will look like this in a
pyproject.toml
:I think it will be beneficial for pre-commit to provide
.pyproject.toml
support as part of its capabilities.Please let me know what you think.
pre-commit --version
latest
The text was updated successfully, but these errors were encountered: