Skip to content

Commit

Permalink
Merge pull request #12 from defold/luacheckrc-on-windows
Browse files Browse the repository at this point in the history
Load luacheckrc on Windows
  • Loading branch information
vlaaad authored May 15, 2024
2 parents ea57cd2 + 3fe4606 commit bf4bbaa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion script/core/diagnostics/luacheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local workspace = require "workspace"
local util = require 'utility'
local fs = require "luacheck.fs"
local inspect = require 'inspect'
local platform = require 'bee.platform'


local config_stack = nil
Expand All @@ -33,8 +34,12 @@ return function (uri, callback)

if not config_stack then
log.info("loading .luacheckrc")
local rootUri = (workspace.rootUri or ""):gsub("file://", "")
local rootUri = (workspace.rootUri or ""):gsub(platform.os == "windows" and "file:///" or "file://", "")
local path = fs.join(rootUri, ".luacheckrc")
if platform.os == 'windows' then
path = path:gsub('/', "\\")
end

local global_path = nil
local config = lcconfig.load_config(path, global_path) or {options={stds={},files={},globals={}}}

Expand Down

0 comments on commit bf4bbaa

Please sign in to comment.