-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Krank checks your code source comments for important markers -- -- Comments are part of our code and are not usually tested correctly. -- Hence their content can become incoherent or obsolete. Krank tries to -- avoid that by running checkers on the comment themselves. @package krank @version 0.2.2 module Krank.Types newtype GithubKey GithubKey :: Text -> GithubKey newtype GitlabHost GitlabHost :: Text -> GitlabHost newtype GitlabKey GitlabKey :: Text -> GitlabKey data Violation Violation :: Text -> ViolationLevel -> Text -> SourcePos -> Violation -- | A textual representation of the checker. Most of the time that's the -- chunck of text parsed [checker] :: Violation -> Text -- | The ViolationLevel associated with the result [level] :: Violation -> ViolationLevel -- | A message describing the error [message] :: Violation -> Text -- | The position in the input sources of the chunck [location] :: Violation -> SourcePos data ViolationLevel Info :: ViolationLevel Warning :: ViolationLevel Error :: ViolationLevel data KrankConfig KrankConfig :: Maybe GithubKey -> Map GitlabHost GitlabKey -> Bool -> Bool -> KrankConfig -- | The github oAuth token [githubKey] :: KrankConfig -> Maybe GithubKey -- | The gitlab oAuth token [gitlabKeys] :: KrankConfig -> Map GitlabHost GitlabKey -- | If True, all IO operations, such as HTTP requests, are ignored [dryRun] :: KrankConfig -> Bool -- | Use color for formatting [useColors] :: KrankConfig -> Bool data SourcePos SourcePos :: FilePath -> Int -> Int -> SourcePos [file] :: SourcePos -> FilePath [lineNumber] :: SourcePos -> Int [colNumber] :: SourcePos -> Int -- | Represents a localized chunk of information in a file data Localized t Localized :: SourcePos -> t -> Localized t [getLocation] :: Localized t -> SourcePos [unLocalized] :: Localized t -> t -- | This monad represents all the effect that Krank needs class (Monad m, MonadCatch m) => MonadKrank m -- | Run a REST requet krankRunRESTRequest :: (MonadKrank m, FromJSON t) => Url 'Https -> Option 'Https -> m t -- | Read the configuration krankAsks :: MonadKrank m => (KrankConfig -> b) -> m b -- | Apply a function on many item in a concurrent way krankMapConcurrently :: MonadKrank m => (a -> m b) -> [a] -> m [b] krankForConcurrently :: MonadKrank m => [a] -> (a -> m b) -> m [b] -- | Read a file from filesystem krankReadFile :: MonadKrank m => FilePath -> m ByteString -- | Log an error (with trailing n) krankPutStrLnStderr :: MonadKrank m => Text -> m () -- | Log a message (without trailing n) krankPutStr :: MonadKrank m => Text -> m () instance GHC.Show.Show Krank.Types.KrankConfig instance GHC.Show.Show Krank.Types.Violation instance GHC.Classes.Eq t => GHC.Classes.Eq (Krank.Types.Localized t) instance GHC.Show.Show t => GHC.Show.Show (Krank.Types.Localized t) instance GHC.Classes.Ord Krank.Types.SourcePos instance GHC.Classes.Eq Krank.Types.SourcePos instance GHC.Show.Show Krank.Types.SourcePos instance GHC.Show.Show Krank.Types.ViolationLevel instance GHC.Classes.Eq Krank.Types.GitlabHost instance GHC.Classes.Ord Krank.Types.GitlabHost instance GHC.Show.Show Krank.Types.GitlabHost instance GHC.Show.Show Krank.Types.GitlabKey instance GHC.Show.Show Krank.Types.GithubKey module Krank.Checkers.Ignore data IgnoreCommand IgnoreLine :: IgnoreCommand -- | Takes a list of Violation, some ignore commands and remove all those -- that are ignored due to an ignore marker filterViolations :: [Violation] -> FilePath -> ByteString -> [Violation] instance GHC.Classes.Eq Krank.Checkers.Ignore.IgnoreCommand instance GHC.Show.Show Krank.Checkers.Ignore.IgnoreCommand module Utils.Display -- | indent the text given by a certain number of space character If the -- text given contains multiple lines, all the lines but the first will -- be prefixed by the continuation character '|' indent :: Int -> Text -> Text module Krank.Formatter showViolation :: Bool -> Violation -> Text module Utils.Req showHTTPException :: (Response () -> ByteString -> Text) -> HttpException -> Text showRawResponse :: Response () -> ByteString -> Text module Utils.Gitlab -- | Uses the helper to show generic HTTP issues and provides a specific -- handler for Gitlab "business" exceptions showGitlabException :: HttpException -> Text gitlabAPILimitErrorText :: Text gitlabNotFoundErrorText :: Text instance Data.Aeson.Types.ToJSON.ToJSON Utils.Gitlab.GitlabError instance Data.Aeson.Types.FromJSON.FromJSON Utils.Gitlab.GitlabError instance GHC.Show.Show Utils.Gitlab.GitlabError instance GHC.Generics.Generic Utils.Gitlab.GitlabError module Utils.Github -- | Uses the helper to show generic HTTP issues and provides a specific -- handler for Github "business" exceptions showGithubException :: HttpException -> Text githubAPILimitErrorText :: Text githubNotFoundErrorText :: Text instance Data.Aeson.Types.ToJSON.ToJSON Utils.Github.GithubError instance Data.Aeson.Types.FromJSON.FromJSON Utils.Github.GithubError instance GHC.Show.Show Utils.Github.GithubError instance GHC.Generics.Generic Utils.Github.GithubError module Krank.Checkers.IssueTracker data GitIssueRef GitIssueRef :: GitServer -> Text -> Text -> Int -> GitIssueRef [$sel:server:GitIssueRef] :: GitIssueRef -> GitServer [$sel:owner:GitIssueRef] :: GitIssueRef -> Text [$sel:repo:GitIssueRef] :: GitIssueRef -> Text [$sel:issueNum:GitIssueRef] :: GitIssueRef -> Int data GitServer Github :: GitServer Gitlab :: GitlabHost -> GitServer -- | Represents a localized chunk of information in a file data Localized t Localized :: SourcePos -> t -> Localized t [getLocation] :: Localized t -> SourcePos [unLocalized] :: Localized t -> t checkText :: MonadKrank m => FilePath -> ByteString -> m [Violation] -- | Extract all issues correctly localized Note: we use ByteString -- internally. This way we do not have to care about the possible -- encoding of the input files. In programming world, we mostly use ascii -- variants. This gives a few performance improvement compared to -- initially converting everything to Text and search on it. extractIssues :: FilePath -> ByteString -> [Localized GitIssueRef] -- | This regex represents a github/gitlab issue URL gitRepoRe :: Regex serverDomain :: GitServer -> Text -- | Extract all issues on one line and returns a list of the raw text -- associated with an issue extractIssuesOnALine :: ByteString -> [(Int, GitIssueRef)] instance GHC.Show.Show Krank.Checkers.IssueTracker.GitIssueData instance GHC.Classes.Eq Krank.Checkers.IssueTracker.GitIssueData instance GHC.Show.Show Krank.Checkers.IssueTracker.GitIssueRef instance GHC.Classes.Eq Krank.Checkers.IssueTracker.GitIssueRef instance GHC.Show.Show Krank.Checkers.IssueTracker.IssueStatus instance GHC.Classes.Eq Krank.Checkers.IssueTracker.IssueStatus instance GHC.Show.Show Krank.Checkers.IssueTracker.GitServer instance GHC.Classes.Eq Krank.Checkers.IssueTracker.GitServer module Krank runKrank :: MonadKrank m => [FilePath] -> m Bool -- | This just exists to avoid the orphan instance on MonadKrank newtype Krank t Krank :: ReaderT KrankConfig IO t -> Krank t [unKrank] :: Krank t -> ReaderT KrankConfig IO t instance Control.Monad.Catch.MonadThrow Krank.Krank instance Control.Monad.Catch.MonadCatch Krank.Krank instance GHC.Base.Monad Krank.Krank instance GHC.Base.Applicative Krank.Krank instance GHC.Base.Functor Krank.Krank instance Krank.Types.MonadKrank Krank.Krank module Version displayVersion :: String