This change introduces a check during parse-tree analysis that dependencies are valid, along with some tests. Note that this could technically happen later during semantic analysis and I will likely move it so that we can get better diagnostics (more errors before failing). I've also cleaned up and unified some of the logic by introducing the general notion of a Visitor interface, which the parse tree analyzer, binder, and analyzers to come will all implement.
22 lines
558 B
Go
22 lines
558 B
Go
// Copyright 2016 Marapongo, Inc. All rights reserved.
|
|
|
|
package errors
|
|
|
|
import (
|
|
"github.com/marapongo/mu/pkg/diag"
|
|
)
|
|
|
|
var MissingMetadataName = &diag.Diag{
|
|
ID: 200,
|
|
Message: "This %v is missing a `name` property (or it is empty)",
|
|
}
|
|
|
|
var IllegalMetadataSemVer = &diag.Diag{
|
|
ID: 1502,
|
|
Message: "This %v's version '%v' is not a valid semantic version number (note: it may not be a range)",
|
|
}
|
|
|
|
var IllegalDependencySemVer = &diag.Diag{
|
|
ID: 1503,
|
|
Message: "Dependency '%v's version '%v' is not a valid semantic version number or range",
|
|
}
|