Skip to content

Commit 213cb58

Browse files
committed
Fix #2343, support pre-commit
1 parent 9187442 commit 213cb58

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- id: lua-language-server-check
3+
language: lua
4+
name: lua language server check
5+
description: >
6+
use lua language server to check lua files
7+
entry: lua-language-server
8+
types:
9+
- lua
10+
args:
11+
- --check
12+
- .

lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
script

lua-language-server

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env lua
2+
local f = '%q'
3+
local args = {
4+
'bee',
5+
debug.getinfo(1).source:match("@?(.*/)[^/]+/") .. 'main.lua',
6+
}
7+
for _, v in ipairs(arg) do
8+
table.insert(args, f:format(v))
9+
end
10+
local isok, reason, ret = os.execute(table.concat(args, ' '))
11+
if type(isok) == type(0) then
12+
ret = isok
13+
end
14+
if ret ~= 0 then
15+
os.exit(1)
16+
end

lua-language-server-scm-1.rockspec

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
local git_ref = '3.15.1'
2+
local modrev = 'scm'
3+
local specrev = '1'
4+
5+
rockspec_format = '3.0'
6+
package = 'lua-language-server'
7+
version = modrev .. '-' .. specrev
8+
9+
local repo_url = 'https://github.com/LuaLS/lua-language-server'
10+
11+
description = {
12+
summary = 'A language server that offers Lua language support - programmed in Lua',
13+
detailed =
14+
[[The Lua language server provides various language features for Lua to make development easier and faster. With nearly a million installs in Visual Studio Code, it is the most popular extension for Lua language support.]],
15+
labels = { 'lua', 'language-server', 'lpeg', 'hacktoberfest', 'lsp', 'lsp-server', 'lpeglabel' },
16+
homepage = repo_url,
17+
license = 'MIT'
18+
}
19+
20+
source = {
21+
url = repo_url .. '/archive/' .. git_ref .. '.zip',
22+
dir = package .. '-' .. git_ref,
23+
}
24+
25+
dependencies = { 'lpeglabel', 'EmmyLuaCodeStyle', 'bee.lua' }
26+
27+
build = {
28+
type = 'builtin',
29+
copy_directories = { 'meta', 'locale' },
30+
install = {
31+
bin = {
32+
[package] = package,
33+
},
34+
conf = {
35+
['../main.lua'] = 'main.lua',
36+
['../debugger.lua'] = 'debugger.lua',
37+
},
38+
}
39+
}

0 commit comments

Comments
 (0)