diff options
| -rwxr-xr-x | Omni/Ci.hs | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -109,7 +109,7 @@ move _ = do /> map Text.unpack /> filter (not <. null) - Log.info ["ci", "running lint on " <> show (length allFiles) <> " files"] + Log.info ["ci", "running lint (checking git diff)"] -- We can't pass all files as arguments if there are too many (ARG_MAX). -- But wait, Omni/Lint.hs takes arguments. @@ -127,14 +127,9 @@ move _ = do -- For now, let's try passing them. If it fails, we might need to batch. lintResult <- do - -- We run lint on all files. - -- Note: calling callProcess with huge list might fail. - -- Let's see if we can avoid passing all files if Lint supports it. - -- Omni/Lint.hs doesn't seem to support directory recursion on its own if passed a dir, - -- it treats args as file paths. - - -- We will try to run it. - (exitCodeLint, _, lintStderr) <- Process.readProcessWithExitCode runlint allFiles "" + -- Run lint without arguments to let it use its default behavior (git diff for clean repos) + -- This is much faster than passing all files individually + (exitCodeLint, _, lintStderr) <- Process.readProcessWithExitCode runlint [] "" pure <| case exitCodeLint of Exit.ExitSuccess -> ("good", "") _ -> ("fail", Text.pack lintStderr) |
