summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2023-08-14 20:47:00 -0400
committerBen Sima <ben@bsima.me>2023-08-16 14:29:43 -0400
commit1fd4c0be9efe017ed9f6f1dd9b5d9ab70b1bcee2 (patch)
tree52ec953af428da4c3350a76f02519e0988a7bc95 /Biz
parent247678afc7c74c98f64e8d19f67355d128946974 (diff)
Lint concurrently
Roughly a 2x speedup.
Diffstat (limited to 'Biz')
-rw-r--r--Biz/Lint.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Biz/Lint.hs b/Biz/Lint.hs
index d7db9d6..b1cc0d4 100644
--- a/Biz/Lint.hs
+++ b/Biz/Lint.hs
@@ -14,6 +14,7 @@ import Biz.Namespace (Ext (..), Namespace (..))
import qualified Biz.Namespace as Namespace
import Biz.Test ((@=?))
import qualified Biz.Test as Test
+import qualified Control.Concurrent.Async as Async
import qualified Data.String as String
import qualified Data.Text as Text
import qualified System.Directory as Directory
@@ -119,7 +120,7 @@ hlint =
{ exe = "hlint",
checkArgs = [],
-- needs apply-refact >0.9.1.0, which needs ghc >9
- --fixArgs = Just ["--refactor", "--refactor-options=-i"]
+ -- fixArgs = Just ["--refactor", "--refactor-options=-i"]
fixArgs = Nothing
}
@@ -152,7 +153,7 @@ run :: Mode -> [FilePath] -> IO [Result]
run mode paths = do
cwd <- Directory.getCurrentDirectory
root <- Environment.getEnv "BIZ_ROOT"
- concat </ traverse (runOne mode root cwd) paths
+ concat </ Async.mapConcurrently (runOne mode root cwd) paths
runOne :: Mode -> FilePath -> FilePath -> FilePath -> IO [Result]
runOne mode root cwd path_ = results +> traverse_ printResult >> results