Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Common helpers for git vogue plugins
- outputGood :: MonadIO m => String -> m ()
- outputUnfortunate :: MonadIO m => String -> m ()
- outputBad :: MonadIO m => String -> m ()
- lineWrap :: Int -> String -> String
- hsProjects :: [FilePath] -> [FilePath] -> Map FilePath [FilePath]
- forProjects :: (MonadIO m, Applicative m) => Map FilePath [FilePath] -> ([FilePath] -> m a) -> m (Map FilePath a)
- getPluginCommand :: String -> String -> IO PluginCommand
- pureSubCommand :: String -> a -> String -> Mod CommandFields a
- data PluginCommand
- forWithKey_ :: Applicative f => Map k v -> (k -> v -> f ()) -> f ()
- forWithKey :: Applicative f => Map k v -> (k -> v -> f a) -> f (Map k a)
Output
outputGood :: MonadIO m => String -> m () Source #
The check went or is going well, this should make the developer happy
outputUnfortunate :: MonadIO m => String -> m () Source #
A non-fatal warning of some sort. The developer should be able to ignore this.
outputBad :: MonadIO m => String -> m () Source #
If any of these appear, you should probably be exploding and the developer will be sad.
FilePath handling
Find .cabal files in hsFiles and arrange children underneath these "headings".
forProjects :: (MonadIO m, Applicative m) => Map FilePath [FilePath] -> ([FilePath] -> m a) -> m (Map FilePath a) Source #
For the given projects, perform the supplied action on each given relative URLS and having set the current directory to the project.
This will also take care of printing out a "Checking project in: " message.
Command line parsing
getPluginCommand :: String -> String -> IO PluginCommand Source #
Get the plugin command requested given a header and a description
pureSubCommand :: String -> a -> String -> Mod CommandFields a Source #
Sub-command helper
data PluginCommand Source #
Arguments to the plugin
Utility
forWithKey_ :: Applicative f => Map k v -> (k -> v -> f ()) -> f () Source #
Helper for traversing a Map with keys
forWithKey :: Applicative f => Map k v -> (k -> v -> f a) -> f (Map k a) Source #