Skip to content

Commit a605ec5

Browse files
committed
Clean luacheck warnings.
1 parent 5fab87f commit a605ec5

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

vendor/clink.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
44
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts
55

6-
-- luacheck: globals clink
6+
-- luacheck: globals CMDER_SESSION
7+
-- luacheck: globals uah_color cwd_color lamb_color clean_color dirty_color conflict_color unknown_color
8+
-- luacheck: globals prompt_homeSymbol prompt_lambSymbol prompt_type prompt_useHomeSymbol prompt_useUserAtHost
9+
-- luacheck: globals prompt_singleLine prompt_includeVersionControl
10+
-- luacheck: globals prompt_overrideGitStatusOptIn prompt_overrideSvnStatusOptIn
11+
-- luacheck: globals clink io.popenyield os.isdir settings.get
712

813
-- At first, load the original clink.lua file
914
-- this is needed as we set the script path to this dir and therefore the original
@@ -191,7 +196,7 @@ end
191196
local function get_dir_contains(path, dirname)
192197

193198
-- return parent path for specified entry (either file or directory)
194-
local function pathname(path)
199+
local function pathname(path) -- luacheck: ignore 432
195200
local prefix = ""
196201
local i = path:find("[\\/:][^\\/:]*$")
197202
if i then
@@ -201,14 +206,14 @@ local function get_dir_contains(path, dirname)
201206
end
202207

203208
-- Navigates up one level
204-
local function up_one_level(path)
209+
local function up_one_level(path) -- luacheck: ignore 432
205210
if path == nil then path = '.' end
206211
if path == '.' then path = clink.get_cwd() end
207212
return pathname(path)
208213
end
209214

210215
-- Checks if provided directory contains git directory
211-
local function has_specified_dir(path, specified_dir)
216+
local function has_specified_dir(path, specified_dir) -- luacheck: ignore 432
212217
if path == nil then path = '.' end
213218
local found_dirs = clink.find_dirs(path..'/'..specified_dir)
214219
if #found_dirs > 0 then return true end
@@ -236,7 +241,7 @@ end
236241
local function get_git_dir(path)
237242

238243
-- return parent path for specified entry (either file or directory)
239-
local function pathname(path)
244+
local function pathname(path) -- luacheck: ignore 432
240245
local prefix = ""
241246
local i = path:find("[\\/:][^\\/:]*$")
242247
if i then
@@ -346,7 +351,7 @@ end
346351
-- Find out current branch
347352
-- @return {false|svn branch name}
348353
---
349-
local function get_svn_branch(svn_dir)
354+
local function get_svn_branch()
350355
local file = io_popenyield("svn info 2>nul")
351356
if not file then
352357
return false
@@ -379,7 +384,7 @@ local function get_git_status()
379384
for line in file:lines() do
380385
local code = line:sub(1, 2)
381386
-- print (string.format("code: %s, line: %s", code, line))
382-
if code == "DD" or code == "AU" or code == "UD" or code == "UA" or code == "DU" or code == "AA" or code == "UU" then
387+
if code == "DD" or code == "AU" or code == "UD" or code == "UA" or code == "DU" or code == "AA" or code == "UU" then -- luacheck: no max line length
383388
is_status = false
384389
conflict_found = true
385390
break
@@ -608,7 +613,7 @@ local function svn_prompt_filter()
608613
end
609614
-- Get the svn status using coroutine if available and option is enabled. Otherwise use a blocking call
610615
local svnStatus
611-
if clink.promptcoroutine and io.popenyield and settings.get("prompt.async") and prompt_overrideSvnStatusOptIn then
616+
if clink.promptcoroutine and io.popenyield and settings.get("prompt.async") and prompt_overrideSvnStatusOptIn then -- luacheck: no max line length
612617
svnStatus = clink_promptcoroutine(function ()
613618
return get_svn_status()
614619
end)

0 commit comments

Comments
 (0)