Closed pedro-andrade-inpe closed 7 years ago
Current configuration file for the CI server:
std = "min"
cache = true
global = false
The integration can be simple if the luacheck is handled as a module. Currently, TerraME knows modules that are in its executable directory. Thus, CMake can put the molule as a library (dll, so, etc). It was created a prototype of the command in TerraME like:
#> terrame -check cellspace.lua
out:
Line: 61 column: 16 code:211 message: unused function 'printTable'
Line: 86 column: 8 code:211 message: unused variable 'dSet'
The code for this:
elseif arg == "-check" then
local file = arguments[argCount + 1]
local luacheck = require("luacheck")
local files = {file}
local options = {std = "min", cache = true, global = false}
local issues = luacheck.check_files(files, options)[1]
for _, issue in ipairs(issues) do
print("Line: "..issue.line.." column: "..issue.column.." code:"..issue.code.." message: "..luacheck.get_message(issue))
end
os.exit(0)
@pedro-andrade-inpe, Now, I need a full specification to continue the integration.
Important link: http://luacheck.readthedocs.io/en/stable/module.html
Distribute luacheck as a TerraME package and Implement command option
-check
to use luacheck to verify the scripts to be executed.