mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
make in_env part of the language api
This commit is contained in:
parent
bcf0230772
commit
ae34a962d7
23 changed files with 73 additions and 92 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import ContextManager
|
||||
from typing import Protocol
|
||||
from typing import Sequence
|
||||
|
||||
|
|
@ -50,6 +51,14 @@ class Language(Protocol):
|
|||
) -> None:
|
||||
...
|
||||
|
||||
# modify the environment for hook execution
|
||||
def in_env(
|
||||
self,
|
||||
prefix: Prefix,
|
||||
version: str,
|
||||
) -> ContextManager[None]:
|
||||
...
|
||||
|
||||
# execute a hook and return the exit code and output
|
||||
def run_hook(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue