Initial commit
This commit is contained in:
commit
209ba130c0
4852 changed files with 1517959 additions and 0 deletions
40
.config/lite-xl/plugins/lintplus/linters/php.lua
Normal file
40
.config/lite-xl/plugins/lintplus/linters/php.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
-- PHP lint plugin for lint+
|
||||
|
||||
--- CONFIG ---
|
||||
|
||||
-- config.lint.php_args: {string}
|
||||
-- passes the specified arguments to php
|
||||
|
||||
--- IMPLEMENTATION ---
|
||||
|
||||
local lintplus = require "plugins.lintplus"
|
||||
|
||||
lintplus.add("php") {
|
||||
filename = "%.php$",
|
||||
procedure = {
|
||||
command = lintplus.args_command(
|
||||
{
|
||||
"php",
|
||||
"-l",
|
||||
lintplus.args,
|
||||
lintplus.filename
|
||||
},
|
||||
"php_args"
|
||||
),
|
||||
interpreter = function (filename, line, context)
|
||||
local line_processed = false
|
||||
return function ()
|
||||
if line_processed then
|
||||
return nil
|
||||
end
|
||||
local message, file, line_num = line:match(
|
||||
"[%a ]+:%s*(.*)%s+in%s+(%g+)%s+on%sline%s+(%d+)"
|
||||
)
|
||||
if line_num then
|
||||
line_processed = true
|
||||
return filename, tonumber(line_num), 1, "error", message
|
||||
end
|
||||
end
|
||||
end
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue