From 74d7931da89ccc892dfb9dccf9b04eb389216903 Mon Sep 17 00:00:00 2001 From: Max R Date: Tue, 3 Mar 2026 08:39:48 -0500 Subject: [PATCH] Configure pyproject.toml to have custom 'pyproject' file type (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. --- identify/extensions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/identify/extensions.py b/identify/extensions.py index 15fdfce..fbcee7c 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -424,6 +424,7 @@ 'poetry.lock': EXTENSIONS['toml'], 'pom.xml': EXTENSIONS['pom'], 'pylintrc': EXTENSIONS['ini'] | {'pylintrc'}, + 'pyproject.toml': EXTENSIONS['toml'] | {'pyproject'}, 'README': EXTENSIONS['txt'], 'Rakefile': EXTENSIONS['rb'], 'rebar.config': EXTENSIONS['erl'],