hadolint-1.17.3: Dockerfile Linter JavaScript API

Safe HaskellNone
LanguageHaskell2010

Hadolint.Rules

Synopsis

Documentation

data Metadata Source #

Constructors

Metadata 

Fields

Instances
Eq Metadata Source # 
Instance details

Defined in Hadolint.Rules

Methods

(==) :: Metadata -> Metadata -> Bool

(/=) :: Metadata -> Metadata -> Bool

data RuleCheck Source #

Constructors

RuleCheck 

Fields

Instances
Eq RuleCheck Source # 
Instance details

Defined in Hadolint.Rules

Methods

(==) :: RuleCheck -> RuleCheck -> Bool

(/=) :: RuleCheck -> RuleCheck -> Bool

Ord RuleCheck Source # 
Instance details

Defined in Hadolint.Rules

Methods

compare :: RuleCheck -> RuleCheck -> Ordering

(<) :: RuleCheck -> RuleCheck -> Bool

(<=) :: RuleCheck -> RuleCheck -> Bool

(>) :: RuleCheck -> RuleCheck -> Bool

(>=) :: RuleCheck -> RuleCheck -> Bool

max :: RuleCheck -> RuleCheck -> RuleCheck

min :: RuleCheck -> RuleCheck -> RuleCheck

newtype RulesConfig Source #

Contains the required parameters for optional rules

Constructors

RulesConfig 

Fields

Instances
Eq RulesConfig Source # 
Instance details

Defined in Hadolint.Rules

Methods

(==) :: RulesConfig -> RulesConfig -> Bool

(/=) :: RulesConfig -> RulesConfig -> Bool

Show RulesConfig Source # 
Instance details

Defined in Hadolint.Rules

Methods

showsPrec :: Int -> RulesConfig -> ShowS

show :: RulesConfig -> String

showList :: [RulesConfig] -> ShowS

Semigroup RulesConfig Source # 
Instance details

Defined in Hadolint.Rules

Methods

(<>) :: RulesConfig -> RulesConfig -> RulesConfig

sconcat :: NonEmpty RulesConfig -> RulesConfig

stimes :: Integral b => b -> RulesConfig -> RulesConfig

Monoid RulesConfig Source # 
Instance details

Defined in Hadolint.Rules

type IgnoreRuleParser = Parsec Void Text Source #

type ParsedFile = [InstructionPos ParsedShell] Source #

type SimpleCheckerWithState state = state -> Linenumber -> Instruction ParsedShell -> (state, Bool) Source #

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 SimpleCheckerWithLine = Linenumber -> Instruction ParsedShell -> Bool Source #

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 CheckerWithState state = state -> Linenumber -> Instruction ParsedShell -> (state, [Metadata]) Source #

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.

link :: Metadata -> Text Source #

instructionRule :: Text -> Severity -> Text -> (Instruction ParsedShell -> Bool) -> Rule Source #

instructionRuleLine :: Text -> Severity -> Text -> SimpleCheckerWithLine -> Rule Source #

instructionRuleState :: Text -> Severity -> Text -> SimpleCheckerWithState state -> state -> Rule Source #

withState :: a -> b -> (a, b) Source #

argumentsRule :: (ParsedShell -> a) -> Arguments ParsedShell -> a Source #

analyze :: [Rule] -> Dockerfile -> [RuleCheck] Source #

ignored :: Dockerfile -> [(Linenumber, [Text])] Source #

allFromImages :: ParsedFile -> [(Linenumber, BaseImage)] Source #

allAliasedImages :: ParsedFile -> [(Linenumber, ImageAlias)] Source #

allImageNames :: ParsedFile -> [(Linenumber, Text)] Source #

previouslyDefinedAliases :: Linenumber -> ParsedFile -> [Text] Source #

Returns a list of all image aliases in FROM instructions that are defined before the given line number.

aliasMustBe :: (Text -> Bool) -> Instruction a -> Bool Source #

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.

fromName :: BaseImage -> Text Source #

fromAlias :: BaseImage -> Maybe ImageAlias Source #

commentMetadata :: PositionedComment -> Metadata Source #

Converts ShellCheck errors into our own errors type

usingProgram :: Text -> ParsedShell -> Bool Source #

stripInstallPrefix :: [Text] -> [Text] Source #

npmVersionPinned :: Rule Source #

Rule for pinning NPM packages to version, tag, or commit supported formats by Hadolint npm install (with no args, in package dir) npm install [@scope/]name npm install [@scope/]nametag npm install [<scope>/]name@version npm install git[+http|+https]:/git-hostgit-user/repo-name[semver:semver] npm install git+ssh:/git-host:git-userrepo-name[semver:semver]

isArchive :: Text -> Bool Source #

isUrl :: Text -> Bool Source #

registryIsAllowed :: Set Registry -> Rule Source #

gems :: ParsedShell -> [Text] Source #