diff options
Diffstat (limited to 'lib/LintWriter.hs')
-rw-r--r-- | lib/LintWriter.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/LintWriter.hs b/lib/LintWriter.hs index eb7d138..2b891c3 100644 --- a/lib/LintWriter.hs +++ b/lib/LintWriter.hs @@ -52,8 +52,9 @@ import Control.Monad.Writer.Lazy (lift) import Data.Bifunctor (Bifunctor (second)) import Data.Map (Map, fromListWith) import Data.Maybe (mapMaybe) +import qualified Data.Set as S import LintConfig (LintConfig') -import TiledAbstract (HasName) +import TiledAbstract (HasName (getName)) import Types (Dep, Hint, Level (..), Lint (..), hint, lintsToHints) @@ -106,9 +107,9 @@ zoom embed extract operation = do -- | "invert" a linter's result, grouping lints by their messages -invertLintResult :: HasName ctxt => LintResult ctxt -> Map Hint [ctxt] +invertLintResult :: HasName ctxt => LintResult ctxt -> Map Hint [Text] invertLintResult (LinterState (lints, ctxt)) = - fromListWith (<>) $ (, [ctxt]) <$> lintsToHints lints + fmap (S.toList . S.fromList . fmap getName) . fromListWith (<>) $ (, [ctxt]) <$> lintsToHints lints resultToDeps :: LintResult a -> [Dep] resultToDeps (LinterState (lints,_)) = mapMaybe lintToDep lints |