Configure pyproject.toml to have custom 'pyproject' file type#581
Open
Configure pyproject.toml to have custom 'pyproject' file type#581
Conversation
a5237c4 to
82bde57
Compare
Member
Author
|
|
|
Thanks Max, I think that is a very neat solution! I was going to say on #578 (but I have been locked out of the conversation) that I completely forgot about the But yes I do think having this as it's own type should allow for much neater configs, both in Cheers |
bn-andrew
approved these changes
Mar 3, 2026
(Sorry not sure what the right terminology is.) The main reason to do this is because `ruff` can lint the `pyproject.toml` file and it uses `types_or` to match files. If `ruff` were to match against 'toml' in its `types_or` it would match too many files. So the idea is to merge this then update ruff's hook definition to ```diff - id: ruff-check name: ruff check description: "Run 'ruff check' for extremely fast Python linting" entry: ruff check --force-exclude language: python + types_or: [python, pyi, jupyter, pyproject] - types_or: [python, pyi, jupyter] ``` I got this idea by looking at how jenkinfiles is defined; although it's a groovy file, it has a custom jenkinsfile-specific file type in this extensions file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Sorry not sure what the right terminology is.)
The main reason to do this is because
ruffcan lint thepyproject.tomlfile and it usestypes_orto match files. Ifruffwere to match against 'toml' in itstypes_orit would match too many files. So the idea is to merge this then update ruff's hook definition toI got this idea by looking at how jenkinfiles is defined; although it's a groovy file, it has a custom jenkinsfile-specific file type in this extensions file.