ci: Add luacheck ci job (#317)

* Add luacheck ci job

* Fix most of the linting issues

* fixup: lint

Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
This commit is contained in:
Simon Hauser
2020-12-09 21:46:41 +01:00
committed by GitHub
parent c276db06e2
commit 141dc6d55e
23 changed files with 148 additions and 356 deletions

View File

@@ -4,7 +4,6 @@ local path = {}
path.separator = package.config:sub(1, 1)
path.home = vim.fn.expand("~")
path.make_relative = function(filepath, cwd)
if not cwd or not filepath then return filepath end
@@ -83,14 +82,14 @@ path.read_file = function(filepath)
end
path.read_file_async = function(filepath, callback)
vim.loop.fs_open(filepath, "r", 438, function(err, fd)
assert(not err, err)
vim.loop.fs_fstat(fd, function(err, stat)
assert(not err, err)
vim.loop.fs_read(fd, stat.size, 0, function(err, data)
assert(not err, err)
vim.loop.fs_close(fd, function(err)
assert(not err, err)
vim.loop.fs_open(filepath, "r", 438, function(err_open, fd)
assert(not err_open, err_open)
vim.loop.fs_fstat(fd, function(err_fstat, stat)
assert(not err_fstat, err_fstat)
vim.loop.fs_read(fd, stat.size, 0, function(err_read, data)
assert(not err_read, err_read)
vim.loop.fs_close(fd, function(err_close)
assert(not err_close, err_close)
return callback(data)
end)
end)