lint-action
lint-action copied to clipboard
Action fails to report lint results on Windows (swift-format-official)
When using this action on Windows, the lint action always succeeds, silently discarding the results. This was observed with the swift-format-official usage, but is likely the case for other tooling as well.
The underling issue here is that run
will use execSync
which will invoke the tool in a subshell. However, the result of the subshell will not be propagated back due to being invoked in a sub-%COMSPEC% environment (https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options).
The solution here is to perform a micro-optimization which will incidentally fix the issue - namely moving away from child_process.execSync
. Using child_process.spawnSync
is better as it can avoid the shell entire (we can still retain the ability to run a shell if needed, but I suspect it is not necessary). This avoids the need to create a new shell environment and run the subprocess.
#218 should be able to demonstrate the test failures at least and hopefully prevent future regressions.
A stale label has been added to this issue because it has been open 15 days with no activity. To keep this issue open, add a comment within 5 days.