diff options
Diffstat (limited to '')
-rw-r--r-- | lib/LintWriter.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/LintWriter.hs b/lib/LintWriter.hs index c8ab6d5..e235fca 100644 --- a/lib/LintWriter.hs +++ b/lib/LintWriter.hs @@ -24,6 +24,7 @@ import Data.Maybe (mapMaybe) import qualified Data.Text as T import Util (PrettyPrint (..)) +import Badges (Badge) import LintConfig (LintConfig') import Tiled2 (HasName) import Types @@ -87,6 +88,11 @@ resultToOffers (LintResult a) = mapMaybe lintToOffer $ snd a resultToLints :: LintResult a -> [Lint] resultToLints (LintResult res) = snd res +resultToBadges :: LintResult a -> [Badge] +resultToBadges (LintResult a) = mapMaybe lintToBadge $ snd a + where lintToBadge (Badge badge) = Just badge + lintToBadge _ = Nothing + resultToAdjusted :: LintResult a -> a resultToAdjusted (LintResult res) = fst res @@ -110,6 +116,9 @@ dependsOn dep = tell' $ Depends dep offersEntrypoint :: Text -> LintWriter a offersEntrypoint text = tell' $ Offers text +offersBadge :: Badge -> LintWriter a +offersBadge badge = tell' $ Badge badge + -- | adjusts the context. Gets a copy of the /current/ context, i.e. one which might -- have already been changed by other lints adjust :: (a -> a) -> LintWriter a |