mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
deprecate python_venv language
This commit is contained in:
parent
0359fae2da
commit
0c1267b214
8 changed files with 73 additions and 29 deletions
|
|
@ -129,11 +129,21 @@ def test_python_hook_weird_setup_cfg(in_git_dir, tempdir_factory, store):
|
|||
)
|
||||
|
||||
|
||||
def test_python_venv(tempdir_factory, store):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'python_venv_hooks_repo',
|
||||
'foo', [os.devnull],
|
||||
f'[{os.devnull!r}]\nHello World\n'.encode(),
|
||||
def test_python_venv_deprecation(store, caplog):
|
||||
config = {
|
||||
'repo': 'local',
|
||||
'hooks': [{
|
||||
'id': 'example',
|
||||
'name': 'example',
|
||||
'language': 'python_venv',
|
||||
'entry': 'echo hi',
|
||||
}],
|
||||
}
|
||||
_get_hook(config, store, 'example')
|
||||
assert caplog.messages[-1] == (
|
||||
'`repo: local` uses deprecated `language: python_venv`. '
|
||||
'This is an alias for `language: python`. '
|
||||
'Often `pre-commit autoupdate --repo local` will fix this.'
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue