From 8f292660630b3154a3441cc673d6aa605f668e5b Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 30 Dec 2021 23:35:10 +0100 Subject: add dot language output for repository map graphs --- lib/CheckDir.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/CheckDir.hs') diff --git a/lib/CheckDir.hs b/lib/CheckDir.hs index cb4f886..1f69abf 100644 --- a/lib/CheckDir.hs +++ b/lib/CheckDir.hs @@ -25,7 +25,7 @@ import Data.Maybe (isJust, mapMaybe) import Data.Text (Text, isInfixOf) import qualified Data.Text as T import Dirgraph (graphToDot, invertGraph, resultToGraph, - unreachableFrom) + takeSubGraph, unreachableFrom) import GHC.Generics (Generic) import LintConfig (LintConfig', configMaxLintLevel) import Paths (normalise, normaliseWithFrag) @@ -107,7 +107,7 @@ instance ToJSON DirResult where . M.toList $ dirresultMaps res) -- unused in the hub, temporarily removed to make the output smaller - -- , "exitGraph" .= showDot (dirresultGraph res) + , "exitGraph" .= showDot (dirresultGraph res) ] , "severity" .= maximumLintLevel res , "mapInfo" .= fmap (\tm -> A.object [ "badges" .= mapresultBadges tm ]) @@ -178,7 +178,10 @@ recursiveCheckDir config prefix root = do pure $ DirResult { dirresultDeps = missingDeps root maps' , dirresultMissingAssets = mAssets , dirresultMaps = maps' - , dirresultGraph = graphToDot exitGraph + , dirresultGraph = + graphToDot + . takeSubGraph 7 root + $ exitGraph } -- cgit v1.2.3