ShellCheck-0.4.6: Shell script analysis tool

Safe Haskell | None
Language | Haskell98

ShellCheck.AnalyzerLib

# Documentation

type Analysis = AnalyzerM () #

type AnalyzerM a = RWS Parameters [TokenComment] Cache a #

nullCheck :: b -> RWST Parameters [TokenComment] Cache Identity () #

data Checker #

Constructors

Checker |
Fields perScript :: Root -> Analysis perToken :: Token -> Analysis

Instances

Monoid Checker # |
Methods mempty :: Checker # mappend :: Checker -> Checker -> Checker # mconcat :: [Checker] -> Checker #

runChecker :: Parameters -> Checker -> [TokenComment] #

composeAnalyzers :: (a -> Analysis) -> (a -> Analysis) -> a -> Analysis #

data Parameters #

Constructors

Parameters |
Fields variableFlow :: [StackData] parentMap :: Map Id Token shellType :: Shell shellTypeSpecified :: Bool rootNode :: Token

data Cache #

Constructors

Cache |

data Scope #

Constructors

SubshellScope String |
NoneScope |

Instances

Eq Scope # |
Methods (==) :: Scope -> Scope -> Bool # (/=) :: Scope -> Scope -> Bool #
Show Scope # |
Methods showsPrec :: Int -> Scope -> ShowS # show :: Scope -> String # showList :: [Scope] -> ShowS #

data StackData #

Constructors

StackScope Scope |
StackScopeEnd |
Assignment (Token, Token, String, DataType) |
Reference (Token, Token, String) |

Instances

Show StackData # |
Methods showsPrec :: Int -> StackData -> ShowS # show :: StackData -> String # showList :: [StackData] -> ShowS #

data DataType #

Constructors

DataString DataSource |
DataArray DataSource |

Instances

Show DataType # |
Methods showsPrec :: Int -> DataType -> ShowS # show :: DataType -> String # showList :: [DataType] -> ShowS #

data DataSource #

Constructors

SourceFrom [Token] |
SourceExternal |
SourceDeclaration |
SourceInteger |

Instances

Show DataSource # |
Methods showsPrec :: Int -> DataSource -> ShowS # show :: DataSource -> String # showList :: [DataSource] -> ShowS #

data VariableState #

Constructors

Dead Token String |
Alive |

Instances

Show VariableState # |
Methods showsPrec :: Int -> VariableState -> ShowS # show :: VariableState -> String # showList :: [VariableState] -> ShowS #

defaultSpec :: Token -> AnalysisSpec #

pScript :: String -> Maybe Token #

producesComments :: Checker -> String -> Maybe Bool #

makeComment :: Severity -> Id -> Code -> String -> TokenComment #

addComment :: MonadWriter [t] m => t -> m () #

warn :: MonadWriter [TokenComment] m => Id -> Code -> String -> m () #

err :: MonadWriter [TokenComment] m => Id -> Code -> String -> m () #

info :: MonadWriter [TokenComment] m => Id -> Code -> String -> m () #

style :: MonadWriter [TokenComment] m => Id -> Code -> String -> m () #

makeParameters :: AnalysisSpec -> Parameters #

prop_determineShell0 :: Bool #

prop_determineShell1 :: Bool #

prop_determineShell2 :: Bool #

prop_determineShell3 :: Bool #

prop_determineShell4 :: Bool #

prop_determineShell5 :: Bool #

prop_determineShell6 :: Bool #

prop_determineShell7 :: Bool #

determineShell :: Token -> Shell #

executableFromShebang :: String -> String #

getParentTree :: Token -> Map Id Token #

getTokenMap :: Token -> Map Id Token #

isQuoteFree :: Map Id Token -> Token -> Bool #

isStrictlyQuoteFree :: Map Id Token -> Token -> Bool #

isQuoteFreeNode :: Bool -> Map Id Token -> Token -> Bool #

isParamTo :: Map Id Token -> String -> Token -> Bool #

getClosestCommand :: Map Id Token -> Token -> Maybe Token #

getClosestCommandM :: MonadReader Parameters m => Token -> m (Maybe Token) #

usedAsCommandName :: Map Id Token -> Token -> Bool #

getPath :: Map Id Token -> Token -> [Token] #

getPathM :: MonadReader Parameters m => Token -> m [Token] #

isParentOf :: Map Id Token -> Token -> Token -> Bool #

parents :: Parameters -> Token -> [Token] #

pathTo :: MonadReader Parameters m => Token -> m [Token] #

tokenIsJustCommandOutput :: Token -> Bool #

getVariableFlow :: Shell -> Map Id Token -> Token -> [StackData] #

leadType :: Shell -> Map Id Token -> Token -> Scope #

getModifiedVariables :: Token -> [(Token, Token, String, DataType)] #

isClosingFileOp :: Token -> Bool #

getReferencedVariableCommand :: Token -> [(Token, Token, String)] #

getModifiedVariableCommand :: Token -> [(Token, Token, [Char], DataType)] #

getIndexReferences :: String -> [String] #

getOffsetReferences :: String -> [String] #

getReferencedVariables :: Map Id Token -> Token -> [(Token, Token, [Char])] #

dataTypeFrom :: (DataSource -> DataType) -> Token -> DataType #

isCommand :: Token -> String -> Bool #

isUnqualifiedCommand :: Token -> String -> Bool #

isCommandMatch :: Token -> (String -> Bool) -> Bool #

isConfusedGlobRegex :: [Char] -> Bool #

isVariableStartChar :: Char -> Bool #

isVariableChar :: Char -> Bool #

variableNameRegex :: Regex #

prop_isVariableName1 :: Bool #

prop_isVariableName2 :: Bool #

prop_isVariableName3 :: Bool #

isVariableName :: [Char] -> Bool #

getVariablesFromLiteralToken :: Token -> [String] #

prop_getVariablesFromLiteral1 :: Bool #

getVariablesFromLiteral :: String -> [String] #

prop_getBracedReference1 :: Bool #

prop_getBracedReference2 :: Bool #

prop_getBracedReference3 :: Bool #

prop_getBracedReference4 :: Bool #

prop_getBracedReference5 :: Bool #

prop_getBracedReference6 :: Bool #

prop_getBracedReference7 :: Bool #

prop_getBracedReference8 :: Bool #

prop_getBracedReference9 :: Bool #

prop_getBracedReference10 :: Bool #

prop_getBracedReference11 :: Bool #

prop_getBracedReference12 :: Bool #

prop_getBracedReference13 :: Bool #

getBracedReference :: [Char] -> [Char] #

prop_getBracedModifier1 :: Bool #

prop_getBracedModifier2 :: Bool #

prop_getBracedModifier3 :: Bool #

getBracedModifier :: [Char] -> [Char] #

potentially :: Monad m => Maybe (m ()) -> m () #

headOrDefault :: t -> [t] -> t #

(!!!) :: [a] -> Int -> Maybe a #

whenShell :: (Foldable t, MonadReader Parameters m) => t Shell -> m () -> m () #

filterByAnnotation :: Token -> [TokenComment] -> [TokenComment] #

runTests :: IO Bool #