Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Support a standalone config file .cython-lint.yml #84

Closed
webknjaz opened this issue Nov 24, 2023 · 2 comments · Fixed by #104
Closed

[FR] Support a standalone config file .cython-lint.yml #84

webknjaz opened this issue Nov 24, 2023 · 2 comments · Fixed by #104

Comments

@webknjaz
Copy link
Contributor

Hi, I'd like to request a feature that is a missing bit for a specific use case.

For projects that use mass maintenance techniques similar to https://github.com/jaraco/skeleton (where there's an upstream Git skeleton that is periodically git merged into downstream), it's important for tools to have their own config files that are auto-detected. The reason is that this maintenance approach causes lower number of merge conflicts compared to having many tool configs in one file.

Examples of modern tools supporting separate non-pyproject config locations (even in the post-PEP 518 world) in the TOML format are Hatch, pip-tools, Poetry, Ruff, Towncrier.

Having experience taking part in implementing this for pip-tools, and leading the review/debates, I want to point out one implementation detail that may come up. It's the naming and the presence of the tool section in a non-pyproject config.
We debated the following options:

  1. Only having it in pyproject.toml as [tool.<tool-name>] and bare keys in the .<tool>.toml one.
  2. Having [<tool-name>] in .<tool>.toml.
  3. Having [tool.<tool-name>] in .<tool>.toml.

We chose the third option. This allows copying the config section across files without changes. It also allows co-existing with other tools. It's also consistent, so the config reader doesn't have to implement multiple fallbacks for reading the config.

This I why I propose having .cython-lint.yml, which would take precedence over pyproject.toml (even when it's empty!). The section header for this file would be the same — [tool.cython-lint].

Here are some of our earlier discussions: jazzband/pip-tools#1863 (comment).

P.S. Many tools also have a --config CLI flag for passing arbitrary file paths. It's not necessary for my use case, but some people may want it at some point.

@MarcoGorelli
Copy link
Owner

hey @webknjaz - thanks for the request. I'm quite tight on time at the moment, but happy to review / approve a PR if anyone fancied raising one

@webknjaz
Copy link
Contributor Author

Thanks for greenlighting it!

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 a pull request may close this issue.

2 participants