Skip to content

Commit 94e3e29

Browse files
chore: luacheck issues
1 parent c15b81f commit 94e3e29

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

.luacheckrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
---@diagnostic disable: lowercase-global
2-
31
std = "luajit+busted"
42

53
-- Rerun tests only if their modification time changed
@@ -14,5 +12,3 @@ ignore = {
1412
read_globals = {
1513
"vim",
1614
}
17-
18-
-- vim: ft=lua

lua/rest-nvim/client/curl/cli.lua

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ function parser.parse_verbose_line(line)
8787
}
8888
end
8989

90-
local VERBOSE_PREFIX_META = "*"
91-
local VERBOSE_PREFIX_REQ_HEADER = ">"
92-
local VERBOSE_PREFIX_REQ_BODY = "}"
90+
local _VERBOSE_PREFIX_META = "*"
91+
local _VERBOSE_PREFIX_REQ_HEADER = ">"
92+
local _VERBOSE_PREFIX_REQ_BODY = "}"
9393
local VERBOSE_PREFIX_RES_HEADER = "<"
94-
local VERBOSE_PREFIX_RES_BODY = "{"
94+
-- NOTE: we don't parse response body with trace output. response body will
95+
-- be sent to `stdout` instead of `stderr`
96+
local _VERBOSE_PREFIX_RES_BODY = "{"
9597
---custom prefix for statistics
9698
local VERBOSE_PREFIX_STAT = "?"
9799

@@ -119,10 +121,7 @@ function parser.parse_verbose(lines)
119121
statistics = {},
120122
}
121123
vim.iter(lines):map(parser.parse_verbose_line):each(function(ln)
122-
if ln.prefix == VERBOSE_PREFIX_META then
123-
elseif ln.prefix == VERBOSE_PREFIX_REQ_HEADER then
124-
elseif ln.prefix == VERBOSE_PREFIX_REQ_BODY then
125-
elseif ln.prefix == VERBOSE_PREFIX_RES_HEADER then
124+
if ln.prefix == VERBOSE_PREFIX_RES_HEADER then
126125
if not response.status then
127126
-- response status
128127
response.status = parser.parse_verbose_status(ln.str)
@@ -133,9 +132,6 @@ function parser.parse_verbose(lines)
133132
response.headers[key:lower()] = value
134133
end
135134
end
136-
elseif ln.prefix == VERBOSE_PREFIX_RES_BODY then
137-
-- we don't parse body here
138-
-- body is sent to stdout while other verbose logs are sent to stderr
139135
elseif ln.prefix == VERBOSE_PREFIX_STAT then
140136
local key, value = parser.parse_stat_pair(ln.str)
141137
if key then

0 commit comments

Comments
 (0)