You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] required default_language_version in precommit config #138
debug-statements hook fails with SyntaxError on Python 3.10+ match statement (uses Python 3.9 env)
When running pre-commit, the debug-statements hook (from pre-commit/pre-commit-hooks) fails to parse files containing Python 3.10+ match / case statements.
src/core/loop/hooks.py - Could not parse ast
Traceback (most recent call last):
File "/home/**/.cache/pre-commit/repof90bh73l/py_env-python3/lib/python3.9/site-packages/pre_commit_hooks/debug_statement_hook.py", line 57, in check_file
ast_obj = ast.parse(f.read(), filename=filename)
File "/home/**/.local/share/uv/python/cpython-3.9.0-linux-x86_64-gnu/lib/python3.9/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "src/core/loop/hooks.py", line 15
match event.name:
^
SyntaxError: invalid syntax
Minimal Reproducible Example
defhandle_event(event):
matchevent.name: # Python 3.10+ syntaxcase"start":
print("Starting...")
case _:
pass
add this in vcs
Suggestions
default_language_version:
python: python3.11 # or python3.12 / python3.10 (match your project)
Activity
fix: set default_language_version for pre-commit (closes SingularityL…