Each of our various CLI flags uses slightly different mechanisms to yield a Data.Project that it can analyze. parse uses Semantic.IO.findFilesInDir, parse --gitDir uses readBlobsFromGitRepo, our Util functions use readProjectFromPaths, Files provides readProject, and there are probably more. This entails a whole lot of duplicated code and pain. Some of this complexity is essential (for parsing from git repos, we need to use Git.lsTree, but we don’t do that for arbitrary directories), but we should provide a single place for blobs, projects, etc. to be read, probably with the Files DSL.
Each of our various CLI flags uses slightly different mechanisms to yield a
Data.Project
that it can analyze.parse
usesSemantic.IO.findFilesInDir
,parse --gitDir
usesreadBlobsFromGitRepo
, ourUtil
functions usereadProjectFromPaths
,Files
providesreadProject
, and there are probably more. This entails a whole lot of duplicated code and pain. Some of this complexity is essential (for parsing from git repos, we need to useGit.lsTree
, but we don’t do that for arbitrary directories), but we should provide a single place for blobs, projects, etc. to be read, probably with theFiles
DSL.