-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell STatic ANalyser -- -- Stan is a Haskell STatic ANalysis CLI tool. See -- README.md for more details. @package stan @version 0.1.3.0 -- | Contains implementation of a function that opens a given file in a -- browser. module Stan.Browse -- | Open a given file in a browser. The function has the following -- algorithm: -- --
-- >>> checkWith (==) [] [] -- True -- -- >>> checkWith (==) [1, 2] [1, 2] -- True -- -- >>> checkWith (==) [1, 2] [2, 1] -- False -- -- >>> checkWith (==) [1, 2] [1] -- False --checkWith :: (a -> b -> Bool) -> [a] -> [b] -> Bool -- | Returns list all element pairs without the following properties: -- --
-- >>> foo [1..3] -- [(1, 2), (1, 3), (2, 3)] --nonRepeatingPairs :: [a] -> [(a, a)] -- | Environment variables for stan. module Stan.EnvVars newtype EnvVars EnvVars :: TaggedTrial Text Bool -> EnvVars [envVarsUseDefaultConfigFile] :: EnvVars -> TaggedTrial Text Bool getEnvVars :: IO EnvVars envVarsToText :: EnvVars -> Text -- | Module that contains code that should trigger various beautiful Stan -- inspections :) module Stan.Example module Stan.Ghc.Compat -- | A Module is a pair of a Unit and a ModuleName. type Module = GenModule Unit -- | A ModuleName is essentially a simple string, e.g. Data.List. data () => ModuleName moduleNameString :: ModuleName -> String -- | Module name (e.g. A.B.C) moduleName :: GenModule unit -> ModuleName -- | Get a string representation of a GenModule that's unique and -- stable across recompilations. eg. -- "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal" moduleStableString :: Module -> String moduleUnitId :: Module -> UnitId -- | A unique, unambiguous name for something, containing information about -- where that thing originated. data () => Name isExternalName :: Name -> Bool -- | Test if the OccName is that for any operator (whether it is a -- data constructor or variable or whatever) isSymOcc :: OccName -> Bool nameModule :: HasDebugCallStack => Name -> Module nameOccName :: Name -> OccName -- | Get a string representation of a Name that's unique and stable -- across recompilations. Used for deterministic generation of binds for -- derived instances. eg. -- "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal$String" nameStableString :: Name -> String occNameString :: OccName -> String -- | A RealSrcSpan delimits a portion of a text file. It could be -- represented by a pair of (line,column) coordinates, but in fact we -- optimise slightly by using more compact representations for -- single-line and zero-length spans, both of which are quite common. -- -- The end position is defined to be the column after the end of -- the span. That is, a span of (1,1)-(1,2) is one character long, and a -- span of (1,1)-(1,1) is zero characters long. -- -- Real Source Span data () => RealSrcSpan srcSpanEndCol :: RealSrcSpan -> Int srcSpanStartCol :: RealSrcSpan -> Int srcSpanStartLine :: RealSrcSpan -> Int srcSpanEndLine :: RealSrcSpan -> Int srcSpanFile :: RealSrcSpan -> FastString mkRealSrcLoc :: FastString -> Int -> Int -> RealSrcLoc -- | Create a SrcSpan between two points in a file mkRealSrcSpan :: RealSrcLoc -> RealSrcLoc -> RealSrcSpan -- | Records what things are "available", i.e. in scope data () => AvailInfo -- | An ordinary identifier in scope, or a field label without a parent -- type (see Note [Representing pattern synonym fields in AvailInfo]). Avail :: GreName -> AvailInfo -- | A type or class in scope -- -- The AvailTC Invariant: If the type or class is itself to be in -- scope, it must be first in this list. Thus, typically: -- --
-- AvailTC Eq [Eq, ==, \/=] --AvailTC :: Name -> [GreName] -> AvailInfo -- | A FastString is a UTF-8 encoded string together with a unique -- ID. All FastStrings are stored in a global hashtable to support -- fast O(1) comparison. -- -- It is also associated with a lazy reference to the Z-encoding of this -- string which is used by the compiler internally. data () => FastString -- | Creates a UTF-8 encoded FastString from a String mkFastString :: String -> FastString type FieldLbl = FieldLabel -- | Fields in an algebraic record type; see Note [FieldLabel]. data () => FieldLabel FieldLabel :: FieldLabelString -> DuplicateRecordFields -> FieldSelectors -> Name -> FieldLabel -- | User-visible label of the field [flLabel] :: FieldLabel -> FieldLabelString -- | Was DuplicateRecordFields on in the defining module for this -- datatype? [flHasDuplicateRecordFields] :: FieldLabel -> DuplicateRecordFields -- | Was FieldSelectors enabled in the defining module for this -- datatype? See Note [NoFieldSelectors] in GHC.Rename.Env [flHasFieldSelector] :: FieldLabel -> FieldSelectors -- | Record selector function [flSelector] :: FieldLabel -> Name -- | Field labels are just represented as strings; they are not necessarily -- unique (even within a module) newtype () => FieldLabelString FieldLabelString :: FastString -> FieldLabelString [field_label] :: FieldLabelString -> FastString -- | ForAllTyFlag -- -- Is something required to appear in source Haskell (Required), -- permitted by request (Specified) (visible type application), or -- prohibited entirely from appearing in source Haskell -- (Inferred)? See Note [VarBndrs, ForAllTyBinders, TyConBinders, -- and visibility] in GHC.Core.TyCo.Rep data () => ForAllTyFlag Invisible :: Specificity -> ForAllTyFlag Required :: ForAllTyFlag pattern Specified :: ForAllTyFlag pattern Inferred :: ForAllTyFlag data () => IfaceTyCon IfaceTyCon :: IfExtName -> IfaceTyConInfo -> IfaceTyCon [ifaceTyConName] :: IfaceTyCon -> IfExtName [ifaceTyConInfo] :: IfaceTyCon -> IfaceTyConInfo data () => IfaceTyConInfo IfaceTyConInfo :: PromotionFlag -> IfaceTyConSort -> IfaceTyConInfo [ifaceTyConIsPromoted] :: IfaceTyConInfo -> PromotionFlag [ifaceTyConSort] :: IfaceTyConInfo -> IfaceTyConSort -- | The various types of TyCons which have special, built-in syntax. data () => IfaceTyConSort -- | a regular tycon IfaceNormalTyCon :: IfaceTyConSort -- | a tuple, e.g. (a, b, c) or (#a, b, c#). The arity is -- the tuple width, not the tycon arity (which is twice the width in the -- case of unboxed tuples). IfaceTupleTyCon :: !Arity -> !TupleSort -> IfaceTyConSort -- | an unboxed sum, e.g. (# a | b | c #) IfaceSumTyCon :: !Arity -> IfaceTyConSort -- | A heterogeneous equality TyCon (i.e. eqPrimTyCon, eqReprPrimTyCon, -- heqTyCon) that is actually being applied to two types of the same -- kind. This affects pretty-printing only: see Note [Equality predicates -- in IfaceType] IfaceEqualityTyCon :: IfaceTyConSort data () => IfaceTyLit IfaceNumTyLit :: Integer -> IfaceTyLit IfaceStrTyLit :: FastString -> IfaceTyLit IfaceCharTyLit :: Char -> IfaceTyLit -- | Is a TyCon a promoted data constructor or just a normal type -- constructor? data () => PromotionFlag NotPromoted :: PromotionFlag IsPromoted :: PromotionFlag data () => TupleSort BoxedTuple :: TupleSort UnboxedTuple :: TupleSort ConstraintTuple :: TupleSort showTUnitId :: UnitId -> Text -- | Wrapper around Haskell module names and conversion functions for GHC -- types. module Stan.Core.ModuleName -- | Wrapper around Haskell module name. newtype ModuleName ModuleName :: Text -> ModuleName [unModuleName] :: ModuleName -> Text -- | Extract ModuleName from Module. fromGhcModule :: Module -> ModuleName -- | Convert ModuleName to ModuleName. fromGhcModuleName :: ModuleName -> ModuleName instance Data.Aeson.Micro.ToJSON Stan.Core.ModuleName.ModuleName instance Data.String.IsString Stan.Core.ModuleName.ModuleName instance Data.Hashable.Class.Hashable Stan.Core.ModuleName.ModuleName instance GHC.Classes.Eq Stan.Core.ModuleName.ModuleName instance GHC.Show.Show Stan.Core.ModuleName.ModuleName module Stan.Hie.Compat -- | Different contexts under which identifiers exist data () => ContextInfo -- | regular variable Use :: ContextInfo MatchBind :: ContextInfo -- | import/export IEThing :: IEType -> ContextInfo TyDecl :: ContextInfo -- | Value binding ValBind :: BindType -> Scope -> Maybe Span -> ContextInfo -- | Pattern binding -- -- This case is tricky because the bound identifier can be used in two -- distinct scopes. Consider the following example (with -- -XViewPatterns) -- --
-- do (b, a, (a -> True)) <- bar -- foo a ---- -- The identifier a has two scopes: in the view pattern (a -- -> True) and in the rest of the do-block in foo -- a. PatternBind :: Scope -> Scope -> Maybe Span -> ContextInfo ClassTyDecl :: Maybe Span -> ContextInfo -- | Declaration Decl :: DeclType -> Maybe Span -> ContextInfo -- | Type variable TyVarBind :: Scope -> TyVarScope -> ContextInfo -- | Record field RecField :: RecFieldContext -> Maybe Span -> ContextInfo -- | Constraint/Dictionary evidence variable binding EvidenceVarBind :: EvVarSource -> Scope -> Maybe Span -> ContextInfo -- | Usage of evidence variable EvidenceVarUse :: ContextInfo -- | A list of type arguments along with their respective visibilities (ie. -- is this an argument that would return True for -- isVisibleForAllTyFlag?). newtype () => HieArgs a HieArgs :: [(Bool, a)] -> HieArgs a data () => HieAST a Node :: SourcedNodeInfo a -> Span -> [HieAST a] -> HieAST a [sourcedNodeInfo] :: HieAST a -> SourcedNodeInfo a [nodeSpan] :: HieAST a -> Span [nodeChildren] :: HieAST a -> [HieAST a] -- | Mapping from filepaths to the corresponding AST newtype () => HieASTs a HieASTs :: Map HiePath (HieAST a) -> HieASTs a [getAsts] :: HieASTs a -> Map HiePath (HieAST a) -- | GHC builds up a wealth of information about Haskell source as it -- compiles it. .hie files are a way of persisting some of this -- information to disk so that external tools that need to work with -- haskell source don't need to parse, typecheck, and rename all over -- again. These files contain: -- --
(?) ≡ True
neg (?) ≡ False
(?) ||| x ≡ x ||| (?) ≡ -- True
(?) PatternBool x ≡ x PatternBool -- (?) ≡ x
-- infixr 7 ***, +++, ??? --fixity :: PatternAst -- | Pattern for the function definition: -- --
-- foo x y = ... --fun :: PatternAst -- | Pattern for a single guard branch: -- --
-- | x < y = ... --guardBranch :: PatternAst -- | Lazy data type field. Comes in two shapes: -- --
-- foo = baz --rhs :: PatternAst -- | Pattern for tuples: -- --
-- foo :: Some -> Type --typeSig :: PatternAst -- | case' is a pattern for case EXP of expression (not -- considering branches). case' :: PatternAst -- | lambdaCase is a pattern for case expression (not -- considering branches). lambdaCase :: PatternAst -- | Pattern to represent one pattern matching branch. patternMatchBranch :: PatternAst -- | Pattern to represent right side of the pattern matching, e.g. -- -> "foo". patternMatchArrow :: PatternAst -> PatternAst -- | Pattern to represent one pattern matching branch on _. patternMatch_ :: PatternAst -> PatternAst -- | Pattern for literals in pattern matching. -- -- Note: presents on GHC >=8.10 only. literalPat :: PatternAst -- | Pattern for _ in pattern matching. -- -- Note: presents on GHC >=8.10 only. wildPat :: PatternAst -- | Annotations for constants: 0, "foo", etc. literalAnns :: NodeAnnotation instance GHC.Classes.Eq Stan.Pattern.Ast.Literal instance GHC.Show.Show Stan.Pattern.Ast.Literal instance GHC.Classes.Eq Stan.Pattern.Ast.PatternAst instance GHC.Show.Show Stan.Pattern.Ast.PatternAst instance Stan.Pattern.Edsl.PatternBool Stan.Pattern.Ast.PatternAst -- | Functions to work with hie specific parts. module Stan.Hie -- | Returns contents of all .hie files recursively in the given -- hie directory. readHieFiles :: FilePath -> IO [HieFile] -- | Get the number of lines of code in the file by analising -- HieFile. countLinesOfCode :: HieFile -> Int -- | Compare two AST nodes on equality. This is a more relaxed version of -- the Eq instance for HieAST because it doesn't compare -- source locations. This function is useful if you want to check whether -- two AST nodes represent the same AST. -- -- This function needs to take the original HieFile because -- constants are not stored in HieAST and to compare constants we -- need to compare parts of source code. eqAst :: forall a. Ord a => HieFile -> HieAST a -> HieAST a -> Bool -- | Take sub-bytestring according to a given span. -- -- When the given source is empty returns Nothing. -- -- TODO: currently works only with single-line spans slice :: RealSrcSpan -> ByteString -> Maybe ByteString -- | Some Inspections require to know about types and some mechanism -- to match types to the given PatternType. This information on -- types/type expressions is taken from HIE files in a more -- suitable view. -- -- Let's take a look at the function foo: -- --
-- foo :: NonEmpty String -> Int ---- -- In HIE files it will be stored as an Array like this: -- --
-- 1 -> Int [] -- 2 -> String [] -- 3 -> NonEmpty [ 2 ] -- 4 -> FunType 3 1 ---- -- This module contains an implementation of the process of retrieval of -- this information from there. module Stan.Hie.MatchType -- | Matching function that searches the array of types recursively. hieMatchPatternType :: Array TypeIndex HieTypeFlat -> PatternType -> TypeIndex -> Bool -- | Some Inspections require to know about AST and some mechanism -- to match parts of syntax tree to the given PatternAst. This -- information on AST expressions is taken from HIE files in a -- more suitable view. -- -- This module contains an implementation of the process of retrieval of -- AST information from HIE files. module Stan.Hie.MatchAst -- | Matching function that matches current AST node with a given pattern. hieMatchPatternAst :: HieFile -> HieAST TypeIndex -> PatternAst -> Bool -- | Css to be used in the generated HTML in the report. module Stan.Report.Css stanCss :: Css -- | Report settings types. module Stan.Report.Settings -- | Settings for produced report. data OutputSettings OutputSettings :: !Verbosity -> !ToggleSolution -> OutputSettings [outputSettingsVerbosity] :: OutputSettings -> !Verbosity [outputSettingsSolutionVerbosity] :: OutputSettings -> !ToggleSolution data Verbosity Verbose :: Verbosity NonVerbose :: Verbosity isVerbose :: Verbosity -> Bool -- | Boolean for showing/hiding solution information of observations. data ToggleSolution HideSolution :: ToggleSolution ShowSolution :: ToggleSolution -- | Is the toggle option set to HideSolution? isHidden :: ToggleSolution -> Bool instance GHC.Show.Show Stan.Report.Settings.Verbosity instance GHC.Show.Show Stan.Report.Settings.ToggleSolution -- | This module introduces Severity data type for expressing how -- severe the message is. Also, it contains useful functions to work with -- Severity. module Stan.Severity -- | Severity level of the inspection. -- -- TODO: table data Severity -- | Code style issues. Usually harmless. Style :: Severity -- | Serious defects that could cause slowness and space leaking. Performance :: Severity -- | Human errors in code. PotentialBug :: Severity -- | Potential runtime errors on some inputs. Warning :: Severity -- | Dangerous behaviour. Error :: Severity -- | Description of each Severity level. severityDescription :: Severity -> Text -- | Get the colour of the severity level. severityColour :: Severity -> Text -- | Show Severity in a human-friendly format. prettyShowSeverity :: Severity -> Text instance GHC.Enum.Bounded Stan.Severity.Severity instance GHC.Enum.Enum Stan.Severity.Severity instance GHC.Classes.Ord Stan.Severity.Severity instance GHC.Classes.Eq Stan.Severity.Severity instance GHC.Read.Read Stan.Severity.Severity instance GHC.Show.Show Stan.Severity.Severity instance Data.Aeson.Micro.ToJSON Stan.Severity.Severity -- | Inspection — check or test provided by Stan. module Stan.Inspection -- | Data type that represents a check/test, or how we call it -- inspection that is provided by the Stan tool. data Inspection Inspection :: !Id Inspection -> !Text -> !Text -> ![Text] -> !NonEmpty Category -> !Severity -> !InspectionAnalysis -> Inspection [inspectionId] :: Inspection -> !Id Inspection [inspectionName] :: Inspection -> !Text [inspectionDescription] :: Inspection -> !Text [inspectionSolution] :: Inspection -> ![Text] [inspectionCategory] :: Inspection -> !NonEmpty Category [inspectionSeverity] :: Inspection -> !Severity [inspectionAnalysis] :: Inspection -> !InspectionAnalysis categoryL :: Lens' Inspection (NonEmpty Category) descriptionL :: Lens' Inspection Text solutionL :: Lens' Inspection [Text] severityL :: Lens' Inspection Severity analysisL :: Lens' Inspection InspectionAnalysis -- | Data type that represents all possible types of stan -- inspections in a uniformed way. data InspectionAnalysis -- | Find the specific part of the Haskell AST (including specific -- functions). FindAst :: !PatternAst -> InspectionAnalysis -- | Find all operators without matching infix[r|l] Infix :: InspectionAnalysis -- | Check if the data type has lazy fields LazyField :: InspectionAnalysis -- | Usage of tuples with size >= 4 BigTuples :: InspectionAnalysis -- | Pattern matching on _ for sum types. PatternMatchOn_ :: InspectionAnalysis -- | Replace multiple comparison operations with compare UseCompare :: InspectionAnalysis -- | Type alias for the HashMap that contains pairs of inspections -- Ids and corresponding Inspections. type InspectionsMap = HashMap (Id Inspection) Inspection -- | Sort Inspection by Id sortById :: InspectionsMap -> [Inspection] -- | Show Inspection in a human-friendly format. prettyShowInspection :: Inspection -> Text -- | Show the short view of a given Inspection. prettyShowInspectionShort :: Inspection -> Text -- | Create the MarkDown text for all inspections. The generated MD has a -- ToC and separate sections for each inspection. -- -- This is used to keep the Wiki page of the project up to date. inspectionsMd :: [Inspection] -> Text instance GHC.Classes.Eq Stan.Inspection.InspectionAnalysis instance GHC.Show.Show Stan.Inspection.InspectionAnalysis instance GHC.Classes.Eq Stan.Inspection.Inspection instance GHC.Show.Show Stan.Inspection.Inspection instance Data.Aeson.Micro.ToJSON Stan.Inspection.Inspection -- | Contains all Inspections for style improvements. -- -- The style inspections are in ranges: -- --
STAN-0301 .. STAN-0400
STAN-0001 .. STAN-0100
STAN-0101 .. STAN-0200
STAN-0201 .. STAN-0300
-- OBS-STAN-XXXX-module-name-hash-10:42 --mkObservationId :: Id Inspection -> ModuleName -> RealSrcSpan -> Id Observation ignoredObservations :: [Id Observation] -> Observations -> ([Id Observation], [Id Observation]) -- | Show Observation in a human-friendly format. prettyShowObservation :: OutputSettings -> Observation -> Text prettyShowIgnoredObservations :: [Id Observation] -> Observations -> Text prettyObservationSource :: Bool -> Observation -> [Text] instance GHC.Classes.Eq Stan.Observation.Observation instance GHC.Show.Show Stan.Observation.Observation instance Data.Aeson.Micro.ToJSON Stan.Observation.Observation -- | File (or module) specific information. module Stan.FileInfo type FileMap = Map FilePath FileInfo -- | File specific information. data FileInfo FileInfo :: !FilePath -> !ModuleName -> !Int -> !Either ExtensionsError ParsedExtensions -> !Either ExtensionsError ParsedExtensions -> !ExtensionsResult -> !Observations -> FileInfo [fileInfoPath] :: FileInfo -> !FilePath [fileInfoModuleName] :: FileInfo -> !ModuleName [fileInfoLoc] :: FileInfo -> !Int [fileInfoCabalExtensions] :: FileInfo -> !Either ExtensionsError ParsedExtensions [fileInfoExtensions] :: FileInfo -> !Either ExtensionsError ParsedExtensions [fileInfoMergedExtensions] :: FileInfo -> !ExtensionsResult [fileInfoObservations] :: FileInfo -> !Observations -- | Return the list of pretty-printed extensions. extensionsToText :: Either ExtensionsError ParsedExtensions -> [Text] -- | Check whether the given extension is disabled isExtensionDisabled :: Extension -> ExtensionsResult -> Bool instance GHC.Classes.Eq Stan.FileInfo.FileInfo instance GHC.Show.Show Stan.FileInfo.FileInfo instance Data.Aeson.Micro.ToJSON Stan.FileInfo.FileInfo -- | HIE AST visitor for single-pass traversal. module Stan.Analysis.Visitor -- | State for the Visitor object that stores all values during a -- single HIE AST traversal. data VisitorState VisitorState :: !Observations -> !HashMap Text () -> !HashMap Text RealSrcSpan -> VisitorState [visitorStateObservations] :: VisitorState -> !Observations [visitorStateFixities] :: VisitorState -> !HashMap Text () [visitorStateOpDecls] :: VisitorState -> !HashMap Text RealSrcSpan -- | Get sized list of all Observations from the given HIE file -- using the created Visitor. getFinalObservations :: HieFile -> Visitor -> Observations -- | Add single Observation to the existing VisitorState. addObservation :: Observation -> State VisitorState () -- | Add Observations to the existing VisitorState. addObservations :: Observations -> State VisitorState () -- | Add single operator infix declaration. addFixity :: Text -> State VisitorState () -- | Add single operator top-level defintion with its position. addOpDecl :: Text -> RealSrcSpan -> State VisitorState () -- | Object that implements the Visitor pattern. newtype Visitor Visitor :: (HieAST TypeIndex -> State VisitorState ()) -> Visitor [unVisitor] :: Visitor -> HieAST TypeIndex -> State VisitorState () -- | Traverse HIE AST starting from a given node using Visitor. visitAst :: Visitor -> HieAST TypeIndex -> State VisitorState () -- | Analysing functions by InspectionAnalysis for the corresponding -- Inspection. module Stan.Analysis.Analyser -- | Analyses the whole AST starting from the very top. analyseAst :: HieFile -> ExtensionsResult -> [Inspection] -> Observations -- | Static analysis of all HIE files. module Stan.Analysis -- | This data type stores all information collected during static -- analysis. data Analysis Analysis :: !Int -> !Int -> !(Set OnOffExtension, Set SafeHaskellExtension) -> !HashSet (Id Inspection) -> !Observations -> !Observations -> !FileMap -> Analysis [analysisModulesNum] :: Analysis -> !Int [analysisLinesOfCode] :: Analysis -> !Int [analysisUsedExtensions] :: Analysis -> !(Set OnOffExtension, Set SafeHaskellExtension) [analysisInspections] :: Analysis -> !HashSet (Id Inspection) [analysisObservations] :: Analysis -> !Observations [analysisIgnoredObservations] :: Analysis -> !Observations [analysisFileMap] :: Analysis -> !FileMap -- | Perform static analysis of given HieFile. runAnalysis :: Map FilePath (Either ExtensionsError ParsedExtensions) -> HashMap FilePath (HashSet (Id Inspection)) -> [Id Observation] -> [HieFile] -> Analysis instance GHC.Show.Show Stan.Analysis.Analysis instance Data.Aeson.Micro.ToJSON Stan.Analysis.Analysis -- | Pretty printing of Stan's analysis. module Stan.Analysis.Pretty -- | Shows analysed output of Stan work. This functions groups -- Observations by FilePath they are found in. prettyShowAnalysis :: Analysis -> OutputSettings -> Text data AnalysisNumbers AnalysisNumbers :: !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Double -> AnalysisNumbers [anModules] :: AnalysisNumbers -> !Int [anLoc] :: AnalysisNumbers -> !Int [anExts] :: AnalysisNumbers -> !Int [anSafeExts] :: AnalysisNumbers -> !Int [anIns] :: AnalysisNumbers -> !Int [anFoundObs] :: AnalysisNumbers -> !Int [anIgnoredObs] :: AnalysisNumbers -> !Int [anHealth] :: AnalysisNumbers -> !Double -- | Enum to describe project health depending on the value of -- anHealth. data ProjectHealth Unhealthy :: ProjectHealth LowHealth :: ProjectHealth MediumHealth :: ProjectHealth Healthy :: ProjectHealth analysisToNumbers :: Analysis -> AnalysisNumbers -- | Show project health as pretty text with 2 digits after dot. prettyHealth :: Double -> Text -- | Calculate ProjectHealth. toProjectHealth :: Double -> ProjectHealth -- | stan runtime configuration that allows customizing the set of -- inspections to check the code against. module Stan.Config -- | Main configuration type for the following purposes: -- --
-- ⓘ Reading Configurations from /home/vrom911/Kowainik/stan/.stan.toml ... -- stan check --exclude --directory=test/ \ -- check --include \ -- check --exclude --inspectionId=STAN-0002 \ -- check --exclude --inspectionId=STAN-0001 --file=src/MyFile.hs -- remove --file=src/Secret.hs -- ignore --id="STAN0001-asdfgh42:42" --configToCliCommand :: Config -> Text -- | Apply configuration to the given list of files to get the set of -- inspections for each file. -- -- The algorithm: -- --
-- stan toml-to-cli --StanTomlToCli :: !TomlToCliArgs -> StanCommand -- |
-- stan cli-to-toml --StanCliToToml :: !CliToTomlArgs -> StanCommand -- |
-- stan inspections-to-md --StanInspectionsToMd :: StanCommand -- | Options used for the main stan command. data StanArgs StanArgs :: !FilePath -> ![FilePath] -> !OutputSettings -> !Maybe ReportArgs -> !TaggedTrial Text Bool -> !Maybe FilePath -> !PartialConfig -> !Bool -> StanArgs -- | Directory with HIE files [stanArgsHiedir] :: StanArgs -> !FilePath -- | Path to .cabal files. [stanArgsCabalFilePath] :: StanArgs -> ![FilePath] -- | Settings for output terminal report [stanArgsOutputSettings] :: StanArgs -> !OutputSettings -- | HTML report settings [stanArgsReport] :: StanArgs -> !Maybe ReportArgs -- | Use default .stan.toml file [stanArgsUseDefaultConfigFile] :: StanArgs -> !TaggedTrial Text Bool -- | Path to a custom configurations file. [stanArgsConfigFile] :: StanArgs -> !Maybe FilePath [stanArgsConfig] :: StanArgs -> !PartialConfig -- | Output the machine-readable output in JSON format instead. [stanArgsJsonOut] :: StanArgs -> !Bool newtype ReportArgs ReportArgs :: Bool -> ReportArgs -- | Open HTML report in a browser [reportArgsBrowse] :: ReportArgs -> Bool -- | Options used for the stan inspection command. newtype InspectionArgs InspectionArgs :: Maybe (Id Inspection) -> InspectionArgs [inspectionArgsId] :: InspectionArgs -> Maybe (Id Inspection) -- | Options used for the stan toml-to-cli command. newtype TomlToCliArgs TomlToCliArgs :: Maybe FilePath -> TomlToCliArgs [tomlToCliArgsFilePath] :: TomlToCliArgs -> Maybe FilePath -- | Options used for the stan cli-to-toml command. data CliToTomlArgs CliToTomlArgs :: !Maybe FilePath -> !PartialConfig -> CliToTomlArgs [cliToTomlArgsFilePath] :: CliToTomlArgs -> !Maybe FilePath [cliToTomlArgsConfig] :: CliToTomlArgs -> !PartialConfig -- | Run main parser of the stan command line tool. runStanCli :: IO StanCommand -- | To turn on some special options. stanParserPrefs :: ParserPrefs stanCliParser :: ParserInfo StanCommand -- | Static analysis summary. module Stan.Analysis.Summary -- | Short info about analysis. data Summary Summary :: !Id Inspection -> !Category -> !ModuleName -> !Severity -> Summary -- | The most popular Inspection [summaryInspectionId] :: Summary -> !Id Inspection -- | The most popular Category [summaryCategory] :: Summary -> !Category -- | Module with the biggest number of observations [summaryModule] :: Summary -> !ModuleName -- | The highest Severity [summarySeverity] :: Summary -> !Severity -- | Assemble Summary after analysis. Returns Nothing when -- there's no Observations. Otherwise, there's at least one -- observation, which means that we can find the most popular -- Inspection, Category and the highest Severity. createSummary :: Analysis -> Maybe Summary -- | HTML to be generated in the report. module Stan.Report.Html stanHtml :: Analysis -> Config -> [Text] -> StanEnv -> ProjectInfo -> Html -- | Report and report settings types. module Stan.Report generateReport :: Analysis -> Config -> [Text] -> StanEnv -> ProjectInfo -> IO () -- | tomland library integration. TomlCodecs for the -- Config data type. module Stan.Toml getTomlConfig :: Bool -> Bool -> Maybe FilePath -> IO PartialConfig configCodec :: TomlCodec PartialConfig -- | Based on the incoming settings returns the TOML configuration files -- that were used to get the final config. usedTomlFiles :: Bool -> Maybe FilePath -> IO [FilePath] -- | Main running module. module Stan run :: IO () runStan :: StanArgs -> IO () getAnalysis :: StanArgs -> Bool -> Config -> [HieFile] -> IO Analysis getStanConfig :: StanArgs -> Bool -> IO (Trial Text Config, Bool, EnvVars) -- | From a given path to cabal files and HieFiles create the map -- from modules (that are in .cabal file) to the resulting parsed -- extensions for each. createCabalExtensionsMap :: Bool -> [FilePath] -> [HieFile] -> IO (Map FilePath (Either ExtensionsError ParsedExtensions))