1
0
Fork 0

Merging upstream version 3.0.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:36:51 +01:00
parent eda8b2e628
commit 689b24add1
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
31 changed files with 215 additions and 350 deletions

View file

@ -3,7 +3,6 @@ from __future__ import annotations
import os
from typing import Sequence
import pre_commit.constants as C
from pre_commit.languages.all import Language
from pre_commit.prefix import Prefix
@ -14,13 +13,16 @@ def run_language(
exe: str,
args: Sequence[str] = (),
file_args: Sequence[str] = (),
version: str = C.DEFAULT,
version: str | None = None,
deps: Sequence[str] = (),
is_local: bool = False,
) -> tuple[int, bytes]:
prefix = Prefix(str(path))
version = version or language.get_default_version()
language.install_environment(prefix, version, deps)
health_error = language.health_check(prefix, version)
assert health_error is None, health_error
with language.in_env(prefix, version):
ret, out = language.run_hook(
prefix,

View file

@ -1,5 +0,0 @@
- id: foo
name: Foo
entry: foo
language: node
files: \.js$

View file

@ -1,3 +0,0 @@
#!/usr/bin/env node
console.log('Hello World');

View file

@ -1,5 +0,0 @@
{
"name": "foo",
"version": "0.0.1",
"bin": {"foo": "./bin/main.js"}
}

View file

@ -1,6 +0,0 @@
- id: versioned-node-hook
name: Versioned node hook
entry: versioned-node-hook
language: node
language_version: 9.3.0
files: \.js$

View file

@ -1,4 +0,0 @@
#!/usr/bin/env node
console.log(process.version);
console.log('Hello World');

View file

@ -1,5 +0,0 @@
{
"name": "versioned-node-hook",
"version": "0.0.1",
"bin": {"versioned-node-hook": "./bin/main.js"}
}

View file

@ -1 +0,0 @@
*.gem

View file

@ -1,5 +0,0 @@
- id: ruby_hook
name: Ruby Hook
entry: ruby_hook
language: ruby
files: \.rb$

View file

@ -1,3 +0,0 @@
#!/usr/bin/env ruby
puts 'Hello world from a ruby hook'

View file

@ -1,9 +0,0 @@
Gem::Specification.new do |s|
s.name = 'ruby_hook'
s.version = '0.1.0'
s.authors = ['Anthony Sottile']
s.summary = 'A ruby hook!'
s.description = 'A ruby hook!'
s.files = ['bin/ruby_hook']
s.executables = ['ruby_hook']
end

View file

@ -1 +0,0 @@
*.gem

View file

@ -1,6 +0,0 @@
- id: ruby_hook
name: Ruby Hook
entry: ruby_hook
language: ruby
language_version: 3.2.0
files: \.rb$

View file

@ -1,4 +0,0 @@
#!/usr/bin/env ruby
puts RUBY_VERSION
puts 'Hello world from a ruby hook'

View file

@ -1,9 +0,0 @@
Gem::Specification.new do |s|
s.name = 'ruby_hook'
s.version = '0.1.0'
s.authors = ['Anthony Sottile']
s.summary = 'A ruby hook!'
s.description = 'A ruby hook!'
s.files = ['bin/ruby_hook']
s.executables = ['ruby_hook']
end

View file

@ -1,5 +0,0 @@
- id: rust-hook
name: rust example hook
entry: rust-hello-world
language: rust
files: ''

View file

@ -1,3 +0,0 @@
[[package]]
name = "rust-hello-world"
version = "0.1.0"

View file

@ -1,3 +0,0 @@
[package]
name = "rust-hello-world"
version = "0.1.0"

View file

@ -1,3 +0,0 @@
fn main() {
println!("hello world");
}