ShellCheck-0.9.0: Shell script analysis tool

Safe Haskell | Safe-Inferred
Language | Haskell98

ShellCheck.Interface

# Documentation

data SystemInterface m #

Constructors

SystemInterface |

Fields

- siReadFile :: Maybe Bool -> String -> m (Either ErrorMessage String)

  Given: What annotations say about including external files (if anything) A resolved filename from siFindSource Read the file or return an error

- siFindSource :: String -> Maybe Bool -> [String] -> String -> m FilePath

  Given: the current script, what annotations say about including external files (if anything) a list of source-path annotations in effect, and a sourced file, find the sourced file

- siGetConfig :: String -> m (Maybe (FilePath, String))

  Get the configuration file (name, contents) for a filename

data CheckSpec #

#### Instances

Instances details

Show CheckSpec # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> CheckSpec -> ShowS show :: CheckSpec -> String showList :: [CheckSpec] -> ShowS
Eq CheckSpec # |
Instance details Defined in ShellCheck.Interface Methods (==) :: CheckSpec -> CheckSpec -> Bool (/=) :: CheckSpec -> CheckSpec -> Bool

data CheckResult #

#### Instances

Instances details

Show CheckResult # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> CheckResult -> ShowS show :: CheckResult -> String showList :: [CheckResult] -> ShowS
Eq CheckResult # |
Instance details Defined in ShellCheck.Interface Methods (==) :: CheckResult -> CheckResult -> Bool (/=) :: CheckResult -> CheckResult -> Bool

data ParseSpec #

#### Instances

Instances details

Show ParseSpec # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> ParseSpec -> ShowS show :: ParseSpec -> String showList :: [ParseSpec] -> ShowS
Eq ParseSpec # |
Instance details Defined in ShellCheck.Interface Methods (==) :: ParseSpec -> ParseSpec -> Bool (/=) :: ParseSpec -> ParseSpec -> Bool

data ParseResult #

#### Instances

Instances details

Show ParseResult # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> ParseResult -> ShowS show :: ParseResult -> String showList :: [ParseResult] -> ShowS
Eq ParseResult # |
Instance details Defined in ShellCheck.Interface Methods (==) :: ParseResult -> ParseResult -> Bool (/=) :: ParseResult -> ParseResult -> Bool

data AnalysisSpec #

data AnalysisResult #

data FormatterOptions #

data Shell #

Constructors

Ksh |
Sh |
Bash |
Dash |

#### Instances

Instances details

Show Shell # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> Shell -> ShowS show :: Shell -> String showList :: [Shell] -> ShowS
Eq Shell # |
Instance details Defined in ShellCheck.Interface Methods (==) :: Shell -> Shell -> Bool (/=) :: Shell -> Shell -> Bool

data ExecutionMode #

Constructors

Executed |
Sourced |

#### Instances

Instances details

Show ExecutionMode # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> ExecutionMode -> ShowS show :: ExecutionMode -> String showList :: [ExecutionMode] -> ShowS
Eq ExecutionMode # |
Instance details Defined in ShellCheck.Interface Methods (==) :: ExecutionMode -> ExecutionMode -> Bool (/=) :: ExecutionMode -> ExecutionMode -> Bool

type ErrorMessage = String #

type Code = Integer #

data Severity #

Constructors

ErrorC |
WarningC |
InfoC |
StyleC |

#### Instances

Instances details

Generic Severity # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep Severity :: Type -> Type Methods from :: Severity -> Rep Severity x to :: Rep Severity x -> Severity
Show Severity # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> Severity -> ShowS show :: Severity -> String showList :: [Severity] -> ShowS
NFData Severity # |
Instance details Defined in ShellCheck.Interface Methods rnf :: Severity -> ()
Eq Severity # |
Instance details Defined in ShellCheck.Interface Methods (==) :: Severity -> Severity -> Bool (/=) :: Severity -> Severity -> Bool
Ord Severity # |
Instance details Defined in ShellCheck.Interface Methods compare :: Severity -> Severity -> Ordering (<) :: Severity -> Severity -> Bool (<=) :: Severity -> Severity -> Bool (>) :: Severity -> Severity -> Bool (>=) :: Severity -> Severity -> Bool max :: Severity -> Severity -> Severity min :: Severity -> Severity -> Severity
type Rep Severity # |

Instance details

Defined in ShellCheck.Interface

type Rep Severity = D1 ('MetaData "Severity" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) ((C1 ('MetaCons "ErrorC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WarningC" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InfoC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StyleC" 'PrefixI 'False) (U1 :: Type -> Type)))

data Position #

#### Instances

Instances details

Generic Position # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep Position :: Type -> Type Methods from :: Position -> Rep Position x to :: Rep Position x -> Position
Show Position # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> Position -> ShowS show :: Position -> String showList :: [Position] -> ShowS
NFData Position # |
Instance details Defined in ShellCheck.Interface Methods rnf :: Position -> ()
Eq Position # |
Instance details Defined in ShellCheck.Interface Methods (==) :: Position -> Position -> Bool (/=) :: Position -> Position -> Bool
Ord Position # |
Instance details Defined in ShellCheck.Interface Methods compare :: Position -> Position -> Ordering (<) :: Position -> Position -> Bool (<=) :: Position -> Position -> Bool (>) :: Position -> Position -> Bool (>=) :: Position -> Position -> Bool max :: Position -> Position -> Position min :: Position -> Position -> Position
type Rep Position # |

Instance details

Defined in ShellCheck.Interface

type Rep Position = D1 ('MetaData "Position" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "Position" 'PrefixI 'True) (S1 ('MetaSel ('Just "posFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "posLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "posColumn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))))

data Comment #

#### Instances

Instances details

Generic Comment # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep Comment :: Type -> Type Methods from :: Comment -> Rep Comment x to :: Rep Comment x -> Comment
Show Comment # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> Comment -> ShowS show :: Comment -> String showList :: [Comment] -> ShowS
NFData Comment # |
Instance details Defined in ShellCheck.Interface Methods rnf :: Comment -> ()
Eq Comment # |
Instance details Defined in ShellCheck.Interface Methods (==) :: Comment -> Comment -> Bool (/=) :: Comment -> Comment -> Bool
type Rep Comment # |

Instance details

Defined in ShellCheck.Interface

type Rep Comment = D1 ('MetaData "Comment" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "Comment" 'PrefixI 'True) (S1 ('MetaSel ('Just "cSeverity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Severity) :*: (S1 ('MetaSel ('Just "cCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Code) :*: S1 ('MetaSel ('Just "cMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

data PositionedComment #

#### Instances

Instances details

Ranged PositionedComment # |
Instance details Defined in ShellCheck.Fixer Methods start :: PositionedComment -> Position # end :: PositionedComment -> Position # overlap :: PositionedComment -> PositionedComment -> Bool # setRange :: (Position, Position) -> PositionedComment -> PositionedComment #
ToJSON PositionedComment # |
Instance details Defined in ShellCheck.Formatter.JSON1 Methods toJSON :: PositionedComment -> Value # toEncoding :: PositionedComment -> Encoding # toJSONList :: [PositionedComment] -> Value # toEncodingList :: [PositionedComment] -> Encoding # omitField :: PositionedComment -> Bool #
ToJSON PositionedComment # |
Instance details Defined in ShellCheck.Formatter.JSON Methods toJSON :: PositionedComment -> Value # toEncoding :: PositionedComment -> Encoding # toJSONList :: [PositionedComment] -> Value # toEncodingList :: [PositionedComment] -> Encoding # omitField :: PositionedComment -> Bool #
Generic PositionedComment # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep PositionedComment :: Type -> Type Methods from :: PositionedComment -> Rep PositionedComment x to :: Rep PositionedComment x -> PositionedComment
Show PositionedComment # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> PositionedComment -> ShowS show :: PositionedComment -> String showList :: [PositionedComment] -> ShowS
NFData PositionedComment # |
Instance details Defined in ShellCheck.Interface Methods rnf :: PositionedComment -> ()
Eq PositionedComment # |
Instance details Defined in ShellCheck.Interface Methods (==) :: PositionedComment -> PositionedComment -> Bool (/=) :: PositionedComment -> PositionedComment -> Bool
type Rep PositionedComment # |

Instance details

Defined in ShellCheck.Interface

type Rep PositionedComment = D1 ('MetaData "PositionedComment" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "PositionedComment" 'PrefixI 'True) ((S1 ('MetaSel ('Just "pcStartPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position) :*: S1 ('MetaSel ('Just "pcEndPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position)) :*: (S1 ('MetaSel ('Just "pcComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment) :*: S1 ('MetaSel ('Just "pcFix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fix)))))

data ColorOption #

Constructors

ColorAuto |
ColorAlways |
ColorNever |

#### Instances

Instances details

Show ColorOption # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> ColorOption -> ShowS show :: ColorOption -> String showList :: [ColorOption] -> ShowS
Eq ColorOption # |
Instance details Defined in ShellCheck.Interface Methods (==) :: ColorOption -> ColorOption -> Bool (/=) :: ColorOption -> ColorOption -> Bool
Ord ColorOption # |
Instance details Defined in ShellCheck.Interface Methods compare :: ColorOption -> ColorOption -> Ordering (<) :: ColorOption -> ColorOption -> Bool (<=) :: ColorOption -> ColorOption -> Bool (>) :: ColorOption -> ColorOption -> Bool (>=) :: ColorOption -> ColorOption -> Bool max :: ColorOption -> ColorOption -> ColorOption min :: ColorOption -> ColorOption -> ColorOption

data TokenComment #

#### Instances

Instances details

Generic TokenComment # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep TokenComment :: Type -> Type Methods from :: TokenComment -> Rep TokenComment x to :: Rep TokenComment x -> TokenComment
Show TokenComment # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> TokenComment -> ShowS show :: TokenComment -> String showList :: [TokenComment] -> ShowS
NFData TokenComment # |
Instance details Defined in ShellCheck.Interface Methods rnf :: TokenComment -> ()
Eq TokenComment # |
Instance details Defined in ShellCheck.Interface Methods (==) :: TokenComment -> TokenComment -> Bool (/=) :: TokenComment -> TokenComment -> Bool
type Rep TokenComment # |

Instance details

Defined in ShellCheck.Interface

type Rep TokenComment = D1 ('MetaData "TokenComment" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "TokenComment" 'PrefixI 'True) (S1 ('MetaSel ('Just "tcId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Id) :*: (S1 ('MetaSel ('Just "tcComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment) :*: S1 ('MetaSel ('Just "tcFix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fix)))))

emptyCheckResult :: CheckResult #

newParseResult :: ParseResult #

newAnalysisSpec :: Token -> AnalysisSpec #

newAnalysisResult :: AnalysisResult #

newFormatterOptions :: FormatterOptions #

newPosition :: Position #

newTokenComment :: TokenComment #

mockedSystemInterface :: [(String, String)] -> SystemInterface Identity #

mockRcFile :: forall {m :: Type -> Type}. Monad m => String -> SystemInterface m -> SystemInterface m #

newParseSpec :: ParseSpec #

emptyCheckSpec :: CheckSpec #

newPositionedComment :: PositionedComment #

newComment :: Comment #

data Fix #

#### Instances

Instances details

ToJSON Fix # |
Instance details Defined in ShellCheck.Formatter.JSON1 Methods toJSON :: Fix -> Value # toEncoding :: Fix -> Encoding # toJSONList :: [Fix] -> Value # toEncodingList :: [Fix] -> Encoding # omitField :: Fix -> Bool #
ToJSON Fix # |
Instance details Defined in ShellCheck.Formatter.JSON Methods toJSON :: Fix -> Value # toEncoding :: Fix -> Encoding # toJSONList :: [Fix] -> Value # toEncodingList :: [Fix] -> Encoding # omitField :: Fix -> Bool #
Monoid Fix |
Instance details Defined in ShellCheck.Fixer Methods mempty :: Fix mappend :: Fix -> Fix -> Fix mconcat :: [Fix] -> Fix
Semigroup Fix |
Instance details Defined in ShellCheck.Fixer Methods (<>) :: Fix -> Fix -> Fix sconcat :: NonEmpty Fix -> Fix stimes :: Integral b => b -> Fix -> Fix
Generic Fix # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep Fix :: Type -> Type Methods from :: Fix -> Rep Fix x to :: Rep Fix x -> Fix
Show Fix # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> Fix -> ShowS show :: Fix -> String showList :: [Fix] -> ShowS
NFData Fix # |
Instance details Defined in ShellCheck.Interface Methods rnf :: Fix -> ()
Eq Fix # |
Instance details Defined in ShellCheck.Interface Methods (==) :: Fix -> Fix -> Bool (/=) :: Fix -> Fix -> Bool
type Rep Fix # |
Instance details Defined in ShellCheck.Interface type Rep Fix = D1 ('MetaData "Fix" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "Fix" 'PrefixI 'True) (S1 ('MetaSel ('Just "fixReplacements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Replacement])))

newFix :: Fix #

data InsertionPoint #

Constructors

InsertBefore |
InsertAfter |

#### Instances

Instances details

Generic InsertionPoint # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep InsertionPoint :: Type -> Type Methods from :: InsertionPoint -> Rep InsertionPoint x to :: Rep InsertionPoint x -> InsertionPoint
Show InsertionPoint # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> InsertionPoint -> ShowS show :: InsertionPoint -> String showList :: [InsertionPoint] -> ShowS
NFData InsertionPoint # |
Instance details Defined in ShellCheck.Interface Methods rnf :: InsertionPoint -> ()
Eq InsertionPoint # |
Instance details Defined in ShellCheck.Interface Methods (==) :: InsertionPoint -> InsertionPoint -> Bool (/=) :: InsertionPoint -> InsertionPoint -> Bool
type Rep InsertionPoint # |
Instance details Defined in ShellCheck.Interface type Rep InsertionPoint = D1 ('MetaData "InsertionPoint" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "InsertBefore" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InsertAfter" 'PrefixI 'False) (U1 :: Type -> Type))

data Replacement #

#### Instances

Instances details

Ranged Replacement # |
Instance details Defined in ShellCheck.Fixer Methods start :: Replacement -> Position # end :: Replacement -> Position # overlap :: Replacement -> Replacement -> Bool # setRange :: (Position, Position) -> Replacement -> Replacement #
ToJSON Replacement # |
Instance details Defined in ShellCheck.Formatter.JSON1 Methods toJSON :: Replacement -> Value # toEncoding :: Replacement -> Encoding # toJSONList :: [Replacement] -> Value # toEncodingList :: [Replacement] -> Encoding # omitField :: Replacement -> Bool #
ToJSON Replacement # |
Instance details Defined in ShellCheck.Formatter.JSON Methods toJSON :: Replacement -> Value # toEncoding :: Replacement -> Encoding # toJSONList :: [Replacement] -> Value # toEncodingList :: [Replacement] -> Encoding # omitField :: Replacement -> Bool #
Generic Replacement # |
Instance details Defined in ShellCheck.Interface Associated Types type Rep Replacement :: Type -> Type Methods from :: Replacement -> Rep Replacement x to :: Rep Replacement x -> Replacement
Show Replacement # |
Instance details Defined in ShellCheck.Interface Methods showsPrec :: Int -> Replacement -> ShowS show :: Replacement -> String showList :: [Replacement] -> ShowS
NFData Replacement # |
Instance details Defined in ShellCheck.Interface Methods rnf :: Replacement -> ()
Eq Replacement # |
Instance details Defined in ShellCheck.Interface Methods (==) :: Replacement -> Replacement -> Bool (/=) :: Replacement -> Replacement -> Bool
type Rep Replacement # |

Instance details

Defined in ShellCheck.Interface

type Rep Replacement = D1 ('MetaData "Replacement" "ShellCheck.Interface" "ShellCheck-0.9.0-6uCWLhcMZkq1cyTXpXjNXm" 'False) (C1 ('MetaCons "Replacement" 'PrefixI 'True) ((S1 ('MetaSel ('Just "repStartPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position) :*: S1 ('MetaSel ('Just "repEndPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position)) :*: (S1 ('MetaSel ('Just "repString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "repPrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "repInsertionPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InsertionPoint)))))

newReplacement :: Replacement #

data CheckDescription #

newCheckDescription :: CheckDescription #