github / semantic

Parsing, analyzing, and comparing source code across many languages
8.97k stars 452 forks source link

Path/project ingestion logic is duplicative and painful #44

Open patrickt opened 5 years ago

patrickt commented 5 years ago

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.

robrix commented 5 years ago

Rephrased as a bug.