-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A framework for pre-commit checks.
--   
--   Make your Haskell git repositories fashionable.
@package git-vogue
@version 0.3.0.2


-- | Common helpers for git vogue plugins
module Git.Vogue.PluginCommon

-- | The check went or is going well, this should make the developer happy
outputGood :: MonadIO m => String -> m ()

-- | A non-fatal warning of some sort. The developer should be able to
--   ignore this.
outputUnfortunate :: MonadIO m => String -> m ()

-- | If any of these appear, you should probably be exploding and the
--   developer will be sad.
outputBad :: MonadIO m => String -> m ()

-- | Convenience for line wrapping long lines.
lineWrap :: Int -> String -> String

-- | Find .cabal files in hsFiles and arrange children underneath these
--   "headings".
hsProjects :: [FilePath] -> [FilePath] -> Map FilePath [FilePath]

-- | 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.
forProjects :: (MonadIO m, Applicative m) => Map FilePath [FilePath] -> ([FilePath] -> m a) -> m (Map FilePath a)

-- | Get the plugin command requested given a header and a description
getPluginCommand :: String -> String -> IO PluginCommand

-- | Sub-command helper
pureSubCommand :: String -> a -> String -> Mod CommandFields a

-- | Arguments to the plugin
data PluginCommand

-- | Check the project for problems.
CmdCheck :: FilePath -> FilePath -> PluginCommand

-- | Fix problems in the project.
CmdFix :: FilePath -> FilePath -> PluginCommand

-- | Report details.
CmdName :: PluginCommand

-- | Helper for traversing a Map with keys
forWithKey_ :: Applicative f => Map k v -> (k -> v -> f ()) -> f ()
forWithKey :: Applicative f => Map k v -> (k -> v -> f a) -> f (Map k a)

module Git.Vogue.Types

-- | Options parsed from the command-line.
data VogueOptions
Options :: SearchMode -> VogueCommand -> [PluginName] -> VCSType -> VogueOptions
[optSearch] :: VogueOptions -> SearchMode
[optCommand] :: VogueOptions -> VogueCommand
[optDisable] :: VogueOptions -> [PluginName]
[optVCS] :: VogueOptions -> VCSType
data VCSType
Git :: VCSType
Null :: VCSType

-- | Commands, with parameters, to be executed.
data VogueCommand

-- | Add git-vogue support to a git repository.
CmdInit :: VogueCommand

-- | Verify that support is installed and plugins happen.
CmdVerify :: VogueCommand

-- | List the plugins that git-vogue knows about.
CmdPlugins :: VogueCommand

-- | Disable a plugin
CmdDisable :: PluginName -> VogueCommand

-- | Enable a plugin
CmdEnable :: PluginName -> VogueCommand

-- | Run check plugins on files in a git repository.
CmdRunCheck :: VogueCommand

-- | Run fix plugins on files in a git repository.
CmdRunFix :: VogueCommand

-- | Phantom type for Statuses related to checking
data Check

-- | Phantom type for Statuses related to fixing
data Fix

-- | Result of running a Plugin
data Result
Success :: Text -> Result
Failure :: Text -> Result
Catastrophe :: Int -> Text -> Result

-- | A plugin that can be told to check or fix a list of files
data Plugin m
Plugin :: PluginName -> Bool -> [FilePath] -> [FilePath] -> m Result -> [FilePath] -> [FilePath] -> m Result -> Plugin m
[pluginName] :: Plugin m -> PluginName
[enabled] :: Plugin m -> Bool
[runCheck] :: Plugin m -> [FilePath] -> [FilePath] -> m Result
[runFix] :: Plugin m -> [FilePath] -> [FilePath] -> m Result
newtype PluginName
PluginName :: Text -> PluginName
[unPluginName] :: PluginName -> Text

-- | We want the flexibility of just checking changed files, or maybe
--   checking all of them.
data SearchMode
FindAll :: SearchMode
FindChanged :: SearchMode
FindSpecific :: [FilePath] -> SearchMode

-- | A thing that can find plugins, for example we might search through the
--   libexec directory for executables.
data PluginDiscoverer m
PluginDiscoverer :: m [Plugin m] -> PluginName -> m () -> PluginName -> m () -> PluginDiscoverer m
[discoverPlugins] :: PluginDiscoverer m -> m [Plugin m]
[disablePlugin] :: PluginDiscoverer m -> PluginName -> m ()
[enablePlugin] :: PluginDiscoverer m -> PluginName -> m ()

-- | A VCS backend, such as git.
data VCS m
VCS :: SearchMode -> m [FilePath] -> m () -> m () -> m Bool -> m FilePath -> VCS m

-- | Find all staged files
[getFiles] :: VCS m -> SearchMode -> m [FilePath]

-- | Install pre-commit hook, will only be called if checkHook returns
--   False
[installHook] :: VCS m -> m ()

-- | Remove pre-commit hook
[removeHook] :: VCS m -> m ()

-- | Check pre-commit hook
[checkHook] :: VCS m -> m Bool

-- | Find the / of the repo
[getTopLevel] :: VCS m -> m FilePath
instance GHC.Show.Show Git.Vogue.Types.VogueOptions
instance GHC.Classes.Eq Git.Vogue.Types.VogueOptions
instance GHC.Show.Show Git.Vogue.Types.SearchMode
instance GHC.Classes.Eq Git.Vogue.Types.SearchMode
instance GHC.Show.Show Git.Vogue.Types.VogueCommand
instance GHC.Classes.Eq Git.Vogue.Types.VogueCommand
instance GHC.Base.Monoid Git.Vogue.Types.PluginName
instance GHC.Base.Semigroup Git.Vogue.Types.PluginName
instance Data.String.IsString Git.Vogue.Types.PluginName
instance GHC.Classes.Eq Git.Vogue.Types.PluginName
instance GHC.Classes.Ord Git.Vogue.Types.PluginName
instance GHC.Show.Show Git.Vogue.Types.PluginName
instance GHC.Classes.Eq Git.Vogue.Types.Result
instance GHC.Classes.Ord Git.Vogue.Types.Result
instance GHC.Show.Show Git.Vogue.Types.Result
instance GHC.Show.Show Git.Vogue.Types.VCSType
instance GHC.Classes.Eq Git.Vogue.Types.VCSType
instance GHC.Show.Show (Git.Vogue.Types.Plugin m)
instance GHC.Classes.Eq (Git.Vogue.Types.Plugin m)
instance GHC.Classes.Ord (Git.Vogue.Types.Plugin m)

module Git.Vogue

-- | Execute a git-vogue command.
runCommand :: forall m. (Applicative m, MonadIO m, Functor m) => VogueCommand -> SearchMode -> [PluginName] -> VCS m -> PluginDiscoverer m -> m ()
success :: MonadIO m => Text -> m a
failure :: MonadIO m => Text -> m a

-- | Output the results of a run and exit with an appropriate return code
exitWithWorst :: MonadIO m => [Result] -> m ()
colorize :: Plugin a -> Result -> Text


-- | Provide a VCS implementation for directories not under version control
module Git.Vogue.VCS.Null
nullVCS :: MonadIO m => VCS m


-- | Provide a VCS implementation for git repositories
module Git.Vogue.VCS.Git
gitVCS :: (Functor m, MonadIO m) => VCS m
git :: MonadIO m => [String] -> m String

module Git.Vogue.PluginDiscoverer.Libexec
libExecDiscoverer :: (Functor m, Applicative m, MonadIO m) => FilePath -> PluginDiscoverer m
