Skip to content

Commit

Permalink
Clean luacheck warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisant996 committed May 15, 2023
1 parent 5fab87f commit a605ec5
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions vendor/clink.lua
Expand Up @@ -3,7 +3,12 @@
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts

-- luacheck: globals clink
-- luacheck: globals CMDER_SESSION
-- luacheck: globals uah_color cwd_color lamb_color clean_color dirty_color conflict_color unknown_color
-- luacheck: globals prompt_homeSymbol prompt_lambSymbol prompt_type prompt_useHomeSymbol prompt_useUserAtHost
-- luacheck: globals prompt_singleLine prompt_includeVersionControl
-- luacheck: globals prompt_overrideGitStatusOptIn prompt_overrideSvnStatusOptIn
-- luacheck: globals clink io.popenyield os.isdir settings.get

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

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

-- Navigates up one level
local function up_one_level(path)
local function up_one_level(path) -- luacheck: ignore 432
if path == nil then path = '.' end
if path == '.' then path = clink.get_cwd() end
return pathname(path)
end

-- Checks if provided directory contains git directory
local function has_specified_dir(path, specified_dir)
local function has_specified_dir(path, specified_dir) -- luacheck: ignore 432
if path == nil then path = '.' end
local found_dirs = clink.find_dirs(path..'/'..specified_dir)
if #found_dirs > 0 then return true end
Expand Down Expand Up @@ -236,7 +241,7 @@ end
local function get_git_dir(path)

-- return parent path for specified entry (either file or directory)
local function pathname(path)
local function pathname(path) -- luacheck: ignore 432
local prefix = ""
local i = path:find("[\\/:][^\\/:]*$")
if i then
Expand Down Expand Up @@ -346,7 +351,7 @@ end
-- Find out current branch
-- @return {false|svn branch name}
---
local function get_svn_branch(svn_dir)
local function get_svn_branch()
local file = io_popenyield("svn info 2>nul")
if not file then
return false
Expand Down Expand Up @@ -379,7 +384,7 @@ local function get_git_status()
for line in file:lines() do
local code = line:sub(1, 2)
-- print (string.format("code: %s, line: %s", code, line))
if code == "DD" or code == "AU" or code == "UD" or code == "UA" or code == "DU" or code == "AA" or code == "UU" then
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
is_status = false
conflict_found = true
break
Expand Down Expand Up @@ -608,7 +613,7 @@ local function svn_prompt_filter()
end
-- Get the svn status using coroutine if available and option is enabled. Otherwise use a blocking call
local svnStatus
if clink.promptcoroutine and io.popenyield and settings.get("prompt.async") and prompt_overrideSvnStatusOptIn then
if clink.promptcoroutine and io.popenyield and settings.get("prompt.async") and prompt_overrideSvnStatusOptIn then -- luacheck: no max line length
svnStatus = clink_promptcoroutine(function ()
return get_svn_status()
end)
Expand Down

0 comments on commit a605ec5

Please sign in to comment.