Skip to content

Conversation

@tomlau10
Copy link
Contributor

@tomlau10 tomlau10 commented Feb 7, 2025

(first thing first, this bug is NOT introduced by recent changes)

Problem

With #3051, now the default check output format is pretty.
But I also want to parse the check.json, so I added --check_out_path=xxx option is my team's project CI:

${LUALS_PATH}/bin/lua-language-server --check=. --check_out_path=${LUALS_RESULT_FILE} --num_threads=2 --checklevel=Error
  • But after adding the --check_out_path=, I then found that --num_threads=2 seems not working 😳
  • However if I add --check_out_path= at the end, it will work 🙄
    # this works ${LUALS_PATH}/bin/lua-language-server --check=. --num_threads=2 --checklevel=Error --check_out_path=${LUALS_RESULT_FILE}

Investigation

Upon investigation, I found that the --num_threads argument is not passed to check workers if it is placed just after a --check_out_path=.
With further debugging, it is due to the incorrect skip pattern for --check_out_path=:

elseif arg:lower():match('%-%-check_out_path') and numThreads > 1 then
if not arg:match('%-%-%w*=') then

  • %w only matches alphanumeric characters
  • but check_out_path contains underscore _
  • => it needs to be [%w_] for it to work
@sumneko sumneko merged commit 115a518 into LuaLS:master Feb 7, 2025
11 checks passed
@tomlau10 tomlau10 deleted the fix/check_out_path branch February 10, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants