SourceGraph 0.7.0.1 → 0.7.0.2
raw patch · 6 files changed
+25/−28 lines, 6 filesdep −extensible-exceptionsdep ~Cabaldep ~Graphalyzedep ~base
Dependencies removed: extensible-exceptions
Dependency ranges changed: Cabal, Graphalyze, base, graphviz, haskell-src-exts
Files
- Analyse.hs +3/−4
- Analyse/Visualise.hs +6/−6
- CabalInfo.hs +1/−1
- Main.hs +1/−1
- Parsing/Types.hs +8/−9
- SourceGraph.cabal +6/−7
Analyse.hs view
@@ -39,9 +39,8 @@ import qualified Data.Graph.Analysis.Reporting as R (DocInline(Bold)) import Data.GraphViz.Types.Canonical import Data.GraphViz.Attributes-import Data.GraphViz.Attributes.Complete( Attribute(OutputOrder, FontSize, Rank)- , OutputMode(EdgesFirst)- , RankType(MinRank))+import Data.GraphViz.Attributes.Complete( Attribute(OutputOrder, FontSize)+ , OutputMode(EdgesFirst)) import System.Random(RandomGen) import Control.Arrow(first)@@ -200,7 +199,7 @@ atts = [ GraphAttrs [OutputOrder EdgesFirst] , NodeAttrs [FontSize 10, style filled] ]- sgAtts = [GraphAttrs [Rank MinRank]]+ sgAtts = [GraphAttrs [rank MinRank]] nSG = DotSG { isCluster = False , subGraphID = Nothing , subGraphStmts = DotStmts { attrStmts = sgAtts
Analyse/Visualise.hs view
@@ -46,7 +46,7 @@ -- | Create the nested 'DotGraph'. drawGraph :: String -> Maybe ModName -> HData' -> DotGraph Node-drawGraph gid mm dg = setID (clustID gid)+drawGraph gid mm dg = setID (toGraphID gid) . graphviz params $ compactData dg' where@@ -60,7 +60,7 @@ -- | One-module-per-cluster 'DotGraph'. drawGraph' :: String -> HData' -> DotGraph Node-drawGraph' gid dg = setID (clustID gid)+drawGraph' gid dg = setID (toGraphID gid) . graphvizClusters params $ compactData dg' where params = Params True gAttrs N undefined modClustAttrs nAttr eAttr@@ -159,7 +159,7 @@ -- function shouldn't touch the the actual 'Node' values. drawClusters :: String -> (HSGraph -> HSClustGraph) -> HData' -> DotGraph Node-drawClusters gid cf dg = setID (clustID gid)+drawClusters gid cf dg = setID (toGraphID gid) . graphvizClusters params $ compactData dg' where params = blankParams { globalAttributes = gAttrs@@ -177,7 +177,7 @@ eAttr = callAttributes' dg' drawLevels :: String -> Maybe ModName -> HData' -> DotGraph Node-drawLevels gid mm hd = setID (clustID gid)+drawLevels gid mm hd = setID (toGraphID gid) $ graphvizClusters params dg' where params = blankParams { globalAttributes = gAttrs@@ -210,11 +210,11 @@ -- Dealing with inter-module imports, etc. drawModules :: String -> MData -> DotGraph Node-drawModules gid md = setID (clustID gid)+drawModules gid md = setID (toGraphID gid) . graphviz params $ graphData md where params = Params True gAttrs clusteredModule cID cAttr nAttr eAttr- cID (_,s) = bool undefined (clustID s) $ (not . null) s+ cID (_,s) = bool undefined (toGraphID s) $ (not . null) s gAttrs = [nodeAttrs] -- [GraphAttrs [toLabel t]] cAttr dp = [GraphAttrs $ directoryAttributes dp] nAttr (n,m) = [ toLabel m
CabalInfo.hs view
@@ -43,7 +43,7 @@ import Data.List(nub) import Data.Maybe(isJust, fromJust)-import Control.Exception.Extensible(SomeException(..), try)+import Control.Exception(SomeException(..), try) import Control.Monad(liftM) import System.FilePath(dropExtension)
Main.hs view
@@ -55,7 +55,7 @@ import System.Environment(getArgs) import Control.Arrow(second) import Control.Monad(liftM)-import Control.Exception.Extensible(SomeException(..), try)+import Control.Exception(SomeException(..), try) import Data.Version(showVersion) import qualified Paths_SourceGraph as Paths(version)
Parsing/Types.hs view
@@ -32,10 +32,9 @@ module Parsing.Types where import Data.Graph.Analysis.Types( ClusterLabel(..)- , ClusterType(..) , Rel) import Data.Graph.Analysis.Reporting(unDotPath)-import Data.GraphViz(GraphID(..), LNodeCluster, NodeCluster(..))+import Data.GraphViz(GraphID(..), ToGraphID(..), LNodeCluster, NodeCluster(..)) import Data.Graph.Inductive.Graph(LNode) import Data.Char(isLetter, isDigit)@@ -203,8 +202,8 @@ go d (p:ps) = C (d,p) $ go (succ d) ps go _ [] = error "Shouldn't be able to have an empty module name." -instance ClusterType ModName where- clustID = clustID . unDotPath . nameOfModule+instance ToGraphID ModName where+ toGraphID = toGraphID . unDotPath . nameOfModule instance ClusterLabel ModName where type Cluster ModName = String@@ -325,11 +324,11 @@ deriving (Eq, Ord, Show, Read) ctypeID :: EntClustType -> GraphID-ctypeID (ClassDefn c) = clustID $ "Class_" ++ escID c-ctypeID (DataDefn d) = clustID $ "Data_" ++ escID d-ctypeID (ClassInst c d) = clustID $ "Class_" ++ escID c ++ "_Data_" ++ escID d-ctypeID (DefInst c) = clustID $ "DefaultInstance_" ++ escID c-ctypeID (ModPath p) = clustID $ "Directory_" ++ escID p+ctypeID (ClassDefn c) = toGraphID $ "Class_" ++ escID c+ctypeID (DataDefn d) = toGraphID $ "Data_" ++ escID d+ctypeID (ClassInst c d) = toGraphID $ "Class_" ++ escID c ++ "_Data_" ++ escID d+ctypeID (DefInst c) = toGraphID $ "DefaultInstance_" ++ escID c+ctypeID (ModPath p) = toGraphID $ "Directory_" ++ escID p escID :: String -> String escID = filter (\c -> isLetter c || isDigit c || c == '_')
SourceGraph.cabal view
@@ -1,5 +1,5 @@ Name: SourceGraph-Version: 0.7.0.1+Version: 0.7.0.2 Synopsis: Static code analysis using graph-theoretic techniques. Description: { Statically analyse Haskell source code using graph-theoretic@@ -67,8 +67,7 @@ Ghc-Options: -Wall Ghc-Prof-Options: -prof -auto-all - Build-Depends: base >= 3 && < 5,- extensible-exceptions,+ Build-Depends: base == 4.*, containers, multiset, filepath,@@ -76,8 +75,8 @@ directory, mtl, fgl >= 5.4.2.3 && < 5.5,- Graphalyze == 0.12.*,- graphviz == 2999.12.*,- Cabal >= 1.8 && < 1.11,- haskell-src-exts >= 1.5.0 && < 1.12.0+ Graphalyze == 0.13.*,+ graphviz == 2999.13.*,+ Cabal >= 1.8 && < 1.15,+ haskell-src-exts >= 1.5.0 && < 1.14.0 }