jorisroovers / gitlint

Linting for your git commit messages
http://jorisroovers.github.io/gitlint
MIT License
806 stars 99 forks source link

[feature] Support PEP518 #380

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

According to https://peps.python.org/pep-0621, any python project should store its metadata in pyproject.toml, not .gitlint, .yamllint.yaml, .vintrc.yml, addon-info.json, or other thing.

Many projects have support PEP621, such as

So I advise this project can support, too.

Before python3.11, toml support must be provided by third-party package, such as

You can use one as extras_require.

After python3.11, tomllib is a builtin package. Not need install any toml package. Remember python<3.11 in requirements.txt

sigmavirus24 commented 1 year ago

According to https://peps.python.org/pep-0621, any python project should store its metadata in pyproject.toml, not .gitlint, .yamllint.yaml, .vintrc.yml, addon-info.json, or other thing.

This is incredibly disingenuous or possibly just a severe misreading of that PEP.

It talks about the format to use if one stores core metadata (in other words, build system related metadata) about a project. It provides allowance for non-core systems to store metadata there - an affordance regretted by many involved in that PEP.

It does not require projects to support it.

Further, gitlint has many issues on/relating to this topic which explain very clearly why gitlint's config will not be read from pyproject.toml

Freed-Wu commented 1 year ago

Oh, its my fault, it should be https://peps.python.org/pep-0518/#tool-table (right, pep only have a number which make it is hard to remember), It suggests every python tool store their setting to pyproject.tomls tool, that is

[tool.gitlint]
ignore-by-title = { regex=".*", ignore=body-is-missing }

This is incredibly disingenuous

I am sorry without offense.

Freed-Wu commented 1 year ago

And search PEP518, it has a same issue https://github.com/jorisroovers/gitlint/issues/115, so it is repeated. Close.

sigmavirus24 commented 1 year ago

To be clear, because you still seem to think the PEPs require support - there is no requirement that tools place configuration there. They merely provide support for naming conventions for sections that tools might use if they want to allow configuration in that file.

There is no requirement or imperative to do so