Skip to content

Commit 5a44d61

Browse files
committed
Redefine 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.
1 parent bc5fa61 commit 5a44d61

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

identify/extensions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@
424424
'poetry.lock': EXTENSIONS['toml'],
425425
'pom.xml': EXTENSIONS['pom'],
426426
'pylintrc': EXTENSIONS['ini'] | {'pylintrc'},
427+
'pyproject.toml': EXTENSIONS['toml'] | {'pyproject'},
427428
'README': EXTENSIONS['txt'],
428429
'Rakefile': EXTENSIONS['rb'],
429430
'rebar.config': EXTENSIONS['erl'],

0 commit comments

Comments
 (0)