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


-- | Dockerfile Linter JavaScript API
--   
--   A smarter Dockerfile linter that helps you build best practice Docker
--   images.
@package hadolint
@version 1.18.0

module Hadolint.Shell
data CmdPart
CmdPart :: !Text -> !Int -> CmdPart
[arg] :: CmdPart -> !Text
[partId] :: CmdPart -> !Int
data Command
Command :: !Text -> [CmdPart] -> [CmdPart] -> Command
[name] :: Command -> !Text
[arguments] :: Command -> [CmdPart]
[flags] :: Command -> [CmdPart]
data ParsedShell
ParsedShell :: !Text -> !ParseResult -> ![Command] -> ParsedShell
[original] :: ParsedShell -> !Text
[parsed] :: ParsedShell -> !ParseResult
[presentCommands] :: ParsedShell -> ![Command]
data ShellOpts
ShellOpts :: Text -> Set Text -> ShellOpts
[shellName] :: ShellOpts -> Text
[envVars] :: ShellOpts -> Set Text
defaultShellOpts :: ShellOpts
addVars :: [Text] -> ShellOpts -> ShellOpts
setShell :: Text -> ShellOpts -> ShellOpts
shellcheck :: ShellOpts -> ParsedShell -> [PositionedComment]
parseShell :: Text -> ParsedShell
findCommandsInResult :: ParseResult -> [Token]
extractTokensWith :: forall a. (Token -> Maybe a) -> ParseResult -> [a]
findPipes :: ParsedShell -> [Token]
hasPipes :: ParsedShell -> Bool
allCommands :: (Command -> Bool) -> ParsedShell -> Bool
noCommands :: (Command -> Bool) -> ParsedShell -> Bool
findCommandNames :: ParsedShell -> [Text]
cmdHasArgs :: Text -> [Text] -> Command -> Bool
cmdHasPrefixArg :: Text -> Text -> Command -> Bool
extractAllArgs :: Token -> [CmdPart]
getArgs :: Command -> [Text]
getAllFlags :: [CmdPart] -> [CmdPart]
getArgsNoFlags :: Command -> [Text]
hasFlag :: Text -> Command -> Bool
hasAnyFlag :: [Text] -> Command -> Bool
hasArg :: Text -> Command -> Bool
dropFlagArg :: [Text] -> Command -> Command
instance GHC.Show.Show Hadolint.Shell.Command
instance GHC.Show.Show Hadolint.Shell.CmdPart

module Hadolint.Rules
data Metadata
Metadata :: Text -> Severity -> Text -> Metadata
[code] :: Metadata -> Text
[severity] :: Metadata -> Severity
[message] :: Metadata -> Text
data RuleCheck
RuleCheck :: Metadata -> Filename -> Linenumber -> Bool -> RuleCheck
[metadata] :: RuleCheck -> Metadata
[filename] :: RuleCheck -> Filename
[linenumber] :: RuleCheck -> Linenumber
[success] :: RuleCheck -> Bool

-- | Contains the required parameters for optional rules
newtype RulesConfig
RulesConfig :: Set Registry -> RulesConfig

-- | The docker registries that are allowed in FROM
[allowedRegistries] :: RulesConfig -> Set Registry
type IgnoreRuleParser = Parsec Void Text
type ParsedFile = [InstructionPos ParsedShell]

-- | A function to check individual dockerfile instructions. It gets the
--   current state and a line number. It should return the new state and
--   whether or not the check passes for the given instruction.
type SimpleCheckerWithState state = state -> Linenumber -> Instruction ParsedShell -> (state, Bool)

-- | A function to check individual dockerfile instructions. It gets the
--   current line number. It should return True if the check passes for the
--   given instruction.
type SimpleCheckerWithLine = (Linenumber -> Instruction ParsedShell -> Bool)

-- | A function to check individual dockerfile instructions. It should
--   return the new state and a list of Metadata records. Each Metadata
--   record signifies a failing check for the given instruction.
type CheckerWithState state = state -> Linenumber -> Instruction ParsedShell -> (state, [Metadata])
link :: Metadata -> Text
type Rule = ParsedFile -> [RuleCheck]
mapInstructions :: CheckerWithState state -> state -> Rule
instructionRule :: Text -> Severity -> Text -> (Instruction ParsedShell -> Bool) -> Rule
instructionRuleLine :: Text -> Severity -> Text -> SimpleCheckerWithLine -> Rule
instructionRuleState :: Text -> Severity -> Text -> SimpleCheckerWithState state -> state -> Rule
withState :: a -> b -> (a, b)
argumentsRule :: (ParsedShell -> a) -> Arguments ParsedShell -> a
analyze :: [Rule] -> Dockerfile -> [RuleCheck]
ignored :: Dockerfile -> [(Linenumber, [Text])]
rules :: [Rule]
optionalRules :: RulesConfig -> [Rule]
allFromImages :: ParsedFile -> [(Linenumber, BaseImage)]
allAliasedImages :: ParsedFile -> [(Linenumber, ImageAlias)]
allImageNames :: ParsedFile -> [(Linenumber, Text)]

-- | Returns a list of all image aliases in FROM instructions that are
--   defined before the given line number.
previouslyDefinedAliases :: Linenumber -> ParsedFile -> [Text]

-- | Returns the result of running the check function on the image alias
--   name, if the passed instruction is a FROM instruction with a stage
--   alias. Otherwise, returns True.
aliasMustBe :: (Text -> Bool) -> Instruction a -> Bool
fromName :: BaseImage -> Text
fromAlias :: BaseImage -> Maybe ImageAlias
shellcheck :: Rule

-- | Converts ShellCheck errors into our own errors type
commentMetadata :: PositionedComment -> Metadata
absoluteWorkdir :: Rule
hasNoMaintainer :: Rule
usingProgram :: Text -> ParsedShell -> Bool
multipleCmds :: Rule
multipleEntrypoints :: Rule
wgetOrCurl :: Rule
invalidCmd :: Rule
noRootUser :: Rule
noCd :: Rule
noSudo :: Rule
noAptGetUpgrade :: Rule
noUntagged :: Rule
noLatestTag :: Rule
aptGetVersionPinned :: Rule
aptGetPackages :: ParsedShell -> [Text]
aptGetCleanup :: Rule
noApkUpgrade :: Rule
apkAddVersionPinned :: Rule
apkAddPackages :: ParsedShell -> [Text]
apkAddNoCache :: Rule
useAdd :: Rule
invalidPort :: Rule
pipVersionPinned :: Rule
stripInstallPrefix :: [Text] -> [Text]

-- | Rule for pinning NPM packages to version, tag, or commit supported
--   formats by Hadolint npm install (with no args, in package dir) npm
--   install [<a>@scope</a>/]<a>name</a> npm install
--   [<a>@scope</a>/]<a>name</a><tt><a>tag</a> npm install
--   [&lt;</tt>scope&gt;/]<a>name</a>@<a>version</a> npm install
--   git[+http|+https]:/<i><a>git-host</a></i><a>git-user</a>/<a>repo-name</a>[semver:<a>semver</a>]
--   npm install
--   git+ssh:/<i><a>git-host</a>:<a>git-user</a></i><a>repo-name</a>[semver:<a>semver</a>]
npmVersionPinned :: Rule
aptGetYes :: Rule
aptGetNoRecommends :: Rule
isArchive :: Text -> Bool
isUrl :: Text -> Bool
copyInsteadAdd :: Rule
copyEndingSlash :: Rule
copyFromExists :: Rule
copyFromAnother :: Rule
fromAliasUnique :: Rule
useShell :: Rule
useJsonArgs :: Rule
noApt :: Rule
usePipefail :: Rule
registryIsAllowed :: Set Registry -> Rule
gemVersionPinned :: Rule
gems :: ParsedShell -> [Text]
instance GHC.Classes.Eq Hadolint.Rules.RulesConfig
instance GHC.Show.Show Hadolint.Rules.RulesConfig
instance GHC.Classes.Eq Hadolint.Rules.RuleCheck
instance GHC.Classes.Eq Hadolint.Rules.Metadata
instance GHC.Base.Semigroup Hadolint.Rules.RulesConfig
instance GHC.Base.Monoid Hadolint.Rules.RulesConfig
instance GHC.Classes.Ord Hadolint.Rules.RuleCheck

module Hadolint.Formatter.Format
severityText :: Severity -> String
stripNewlines :: String -> String
errorMessageLine :: (Stream s, ShowErrorComponent e) => ParseErrorBundle s e -> String
errorPosition :: Stream s => ParseErrorBundle s e -> SourcePos
errorPositionPretty :: Stream s => ParseErrorBundle s e -> String
errorBundlePretty :: (Stream s, ShowErrorComponent e) => ParseErrorBundle s e -> String
data Result s e
Result :: Seq (ParseErrorBundle s e) -> Seq RuleCheck -> Result s e
[errors] :: Result s e -> Seq (ParseErrorBundle s e)
[checks] :: Result s e -> Seq RuleCheck
isEmpty :: Result s e -> Bool
toResult :: Either (ParseErrorBundle s e) [RuleCheck] -> Result s e
instance GHC.Base.Semigroup (Hadolint.Formatter.Format.Result s e)
instance GHC.Base.Monoid (Hadolint.Formatter.Format.Result s e)

module Hadolint.Formatter.TTY
printResult :: (Stream s, ShowErrorComponent e) => Result s e -> IO ()
formatError :: (Stream s, ShowErrorComponent e) => ParseErrorBundle s e -> String
formatChecks :: Functor f => f RuleCheck -> f Text

module Hadolint.Formatter.Json
printResult :: (Stream s, ShowErrorComponent e) => Result s e -> IO ()
formatResult :: (Stream s, ShowErrorComponent e) => Result s e -> Value
instance (Text.Megaparsec.Stream.Stream s, Text.Megaparsec.Error.ShowErrorComponent e) => Data.Aeson.Types.ToJSON.ToJSON (Hadolint.Formatter.Json.JsonFormat s e)

module Hadolint.Formatter.Codeclimate
printResult :: (Stream s, ShowErrorComponent e) => Result s e -> IO ()
formatResult :: (Stream s, ShowErrorComponent e) => Result s e -> Seq Issue
instance GHC.Generics.Generic Hadolint.Formatter.Codeclimate.Pos
instance Data.Aeson.Types.ToJSON.ToJSON Hadolint.Formatter.Codeclimate.Issue
instance Data.Aeson.Types.ToJSON.ToJSON Hadolint.Formatter.Codeclimate.Location
instance Data.Aeson.Types.ToJSON.ToJSON Hadolint.Formatter.Codeclimate.Pos

module Hadolint.Formatter.Codacy
printResult :: (Stream s, ShowErrorComponent e) => Result s e -> IO ()
formatResult :: (Stream s, ShowErrorComponent e) => Result s e -> Seq Issue
instance Data.Aeson.Types.ToJSON.ToJSON Hadolint.Formatter.Codacy.Issue

module Hadolint.Formatter.Checkstyle
printResult :: (Stream s, ShowErrorComponent e) => Result s e -> IO ()
formatResult :: (Stream s, ShowErrorComponent e) => Result s e -> Builder

module Hadolint.Lint
type IgnoreRule = Text
type TrustedRegistry = Text
data LintOptions
LintOptions :: [IgnoreRule] -> RulesConfig -> LintOptions
[ignoreRules] :: LintOptions -> [IgnoreRule]
[rulesConfig] :: LintOptions -> RulesConfig
data OutputFormat
Json :: OutputFormat
TTY :: OutputFormat
CodeclimateJson :: OutputFormat
Checkstyle :: OutputFormat
Codacy :: OutputFormat
printResultsAndExit :: OutputFormat -> Result Text DockerfileError -> IO ()

-- | Performs the process of parsing the dockerfile and analyzing it with
--   all the applicable rules, depending on the list of ignored rules.
--   Depending on the preferred printing format, it will output the results
--   to stdout
lint :: LintOptions -> NonEmpty String -> IO (Result Text DockerfileError)

-- | Returns the result of applying all the rules to the given dockerfile
analyzeAll :: RulesConfig -> Dockerfile -> [RuleCheck]

-- | Helper to analyze AST quickly in GHCI
analyzeEither :: RulesConfig -> Either t Dockerfile -> [RuleCheck]
instance GHC.Classes.Eq Hadolint.Lint.OutputFormat
instance GHC.Show.Show Hadolint.Lint.OutputFormat
instance GHC.Show.Show Hadolint.Lint.LintOptions

module Hadolint.Config

-- | If both the ignoreRules and rulesConfig properties of Lint options are
--   empty then this function will fill them with the default found in the
--   passed config file. If there is an error parsing the default config
--   file, this function will return the error string.
applyConfig :: Maybe FilePath -> LintOptions -> IO (Either String LintOptions)
data ConfigFile
ConfigFile :: Maybe [IgnoreRule] -> Maybe [TrustedRegistry] -> ConfigFile
[ignoredRules] :: ConfigFile -> Maybe [IgnoreRule]
[trustedRegistries] :: ConfigFile -> Maybe [TrustedRegistry]
instance GHC.Generics.Generic Hadolint.Config.ConfigFile
instance GHC.Classes.Eq Hadolint.Config.ConfigFile
instance GHC.Show.Show Hadolint.Config.ConfigFile
instance Data.YAML.FromYAML Hadolint.Config.ConfigFile

module Hadolint
