Documentation
¶
Overview ¶
Package guide is the guide's example in miniature, for the front ends' tests: a vocabulary of packages and their imports, and the questions both front ends' TestEval ask of it, so the two languages are scored on the same cases. Only tests import it, and it imports no front end, so the front ends can be modules of their own without the root depending on one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cases = []Case{ {Name: "direct", Question: "what does app import directly?", Want: [][]string{{"api"}}}, {Name: "transitive", Question: "what does app depend on, directly or not?", Want: [][]string{{"api"}, {"log"}, {"util"}}}, {Name: "license", Question: "what license does util have?", Want: [][]string{{"Apache-2.0"}}}, {Name: "unstated", Question: "which packages have no license stated?", Want: [][]string{{"api"}}}, {Name: "count", Question: "how many packages does app depend on?", Want: [][]string{{"3"}}}, {Name: "reverse", Question: "what imports util?", Want: [][]string{{"log"}}}, {Name: "columns", Question: "list every package with its license", Want: [][]string{{"app", "MIT"}, {"api", "absent"}, {"log", ""}, {"util", "Apache-2.0"}}}, {Name: "missing", Question: "who maintains api?", Want: [][]string{{"someone"}}}, }
Cases are questions as the guide asks them, with the rows a right program answers.
var CypherDrafts = map[string][]string{
"what does app import directly?": {`MATCH (:Package {name: 'app'})-[:IMPORTS]->(d) RETURN d.name`},
"what does app depend on, directly or not?": {`MATCH (:Pakage {name: 'app'})-[:IMPORTS*]->(d) RETURN DISTINCT d.name`, `MATCH (:Package {name: 'app'})-[:IMPORTS*]->(d) RETURN DISTINCT d.name`},
"what license does util have?": {`MATCH (p:Package {name: 'util'}) RETURN p.license`},
"which packages have no license stated?": {`MATCH (p:Package) WHERE p.license IS NULL RETURN p.name`},
"how many packages does app depend on?": {`MATCH (:Package {name: 'app'})-[:IMPORTS*]->(d) RETURN count(DISTINCT d)`},
"what imports util?": {`MATCH (x:Package)-[:IMPORTS]->(:Package {name: 'util'}) RETURN x.name`},
"list every package with its license": {`MATCH (p:Package) RETURN p.name, p.license`},
"who maintains api?": {`MATCH (p:Package {name: 'api'}) RETURN p.maintainer`, `MATCH (p:Package {name: 'api'}) RETURN p.maintainer`},
}
CypherDrafts are the Cypher a scripted model writes for the guide's questions (guide.Cases), the ones the drafting arm's TestEval asks in jaala's syntax (nlmodels/translator), in the order it writes them: a right query for each, after a misspelled label for "transitive", which the refusal's did-you-mean fixes, and for "missing", the property the graph doesn't have, which Compile refuses and the model writes again.
Functions ¶
func Code ¶ added in v0.1.98
Code is a small graph laid out as Declaire lays out its own: node(id, kind), attr(id, key, value), and an edge relation per kind. goapp's Auth contains a callsite whose callee is oneauth's Get, and calls holds no edge across the two repos, as Declaire's doesn't. TestParse reaches oneauth's Parse through a helper, two calls away. Its shape for nl.Paths is node for kinds, calls and contains for edges, and attr's callee for a ref (#514 piece 5).
func Deps ¶
Deps is app importing api, api importing log, log importing util, four packages' licenses (api's absent, log's empty), and the deps module reaching through imports.
func Vocabulary ¶ added in v0.1.80
Vocabulary is Deps' vocabulary over src, which serves Source's relations: stdlib and the deps module, so a store holding the same facts answers the guide's questions too.