Add naive and untested version of Lua language support.

This commit is contained in:
Matt Layman 2021-12-12 01:57:54 -05:00 committed by Anthony Sottile
parent 7a305e5d9a
commit 3f8be7400d
13 changed files with 286 additions and 2 deletions

View file

@ -3,7 +3,7 @@ import sys
LANGUAGES = [
'conda', 'coursier', 'dart', 'docker', 'docker_image', 'dotnet', 'fail',
'golang', 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust',
'golang', 'lua', 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust',
'script', 'swift', 'system',
]
FIELDS = [

5
testing/get-lua.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
# Install the runtime and package manager.
sudo apt install lua5.3 liblua5.3-dev luarocks

View file

@ -0,0 +1,4 @@
- id: hello-world-lua
name: hello world lua
entry: hello-world-lua
language: lua

View file

@ -0,0 +1,3 @@
#!/usr/bin/env lua
print('hello world')

View file

@ -0,0 +1,15 @@
package = "hello"
version = "dev-1"
source = {
url = "git+ssh://git@github.com/pre-commit/pre-commit.git"
}
description = {}
dependencies = {}
build = {
type = "builtin",
modules = {},
install = {
bin = {"bin/hello-world-lua"}
},
}

View file

@ -48,6 +48,10 @@ skipif_cant_run_docker = pytest.mark.skipif(
os.name == 'nt' or not docker_is_running(),
reason="Docker isn't running or can't be accessed",
)
skipif_cant_run_lua = pytest.mark.skipif(
os.name == 'nt',
reason="lua isn't installed or can't be found",
)
skipif_cant_run_swift = pytest.mark.skipif(
parse_shebang.find_executable('swift') is None,
reason="swift isn't installed or can't be found",