Repository navigation
compiler: conformance cases for own-schema paths (specification#11, part 1) - #12
Merged
Merged
Conversation
…art) A package's own schemas are reached only through package::, parent:: or self::; an absolute first segment is std or a dependency. New group imports: a bare path to an own schema, in each form of a use, is import::bare-own-schema-path; the relative forms, a dependency's and std's paths build; a path matching nothing is import::unresolved; a schema named like a dependency, and the reserved dependency names (std, package, parent, self), are refused. bounded's three uses of the package's own models schema say package::. Groups and the format cases stay with specification#11.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #11, which stays open: this is only the own-schema-path cases. Epic: ComlineProject/core#281. Proposal: Own schemas, provenance and dependency groups (docs#178, docs#181). The rule itself is core#282.
The rule the cases hold implementations to
Within a package, its own schemas are reached only as
package::...,parent::...orself::.... An absolute first segment of auseisstdor a dependency. A bare path that reaches one of the package's own schemas is an error at once (no edition, no deprecation period).New group
imports(compiler/src/imports.cue->compiler/cases/imports.json)Errors, code
import::bare-own-schema-path:bare-own-item,bare-own-namespace,bare-own-multi,bare-own-glob: each form of ause(use models::Blob,use models,use models::{Blob, Tag},use models::*);bare-own-nested: a schema in a directory (use shapes::models::Blobfromshapes/api).Clean, the same schemas through the relative forms:
package-item,package-namespace(with a qualified referencemodels::Blobafter it),package-multi,package-glob,package-nested;parent-item,self-item.A first segment that isn't the package's:
dependency-path: a bare path naming a dependency builds;std-path: a bare path namingstdbuilds (use std::http::Request);unknown-first-segment: a bare path that matches nothing is stillimport::unresolved, not the new error.What keeps a first segment from meaning two things (no code; the cases say what the message contains, as
acceptancedoes):own-schema-named-like-dependency: the shadowing guard (core#256) refuses a package with a dependency and an own schema of the same first word;dependency-named-std,dependency-named-package,dependency-named-parent,dependency-named-self: the reserved dependency names.bounded's three uses of the package's ownmodelsschema now saypackage::models::Blob(ids and outcomes unchanged).Catalog
The catalog (
catalog/) has no diagnostics section yet; the codes the corpus uses are the closed list inspecs/compiler.cue. The newimport::bare-own-schema-path, andimport::unresolved(existing in core, first used by a case here), are added there, in thefamily::kebab-namestyle ofunverified::andsettings::. When the catalog grows diagnostics (shared-vocabulary kinddiagnostic), they move with the rest.Version
VERSIONis not bumped. It moves for wire and profile changes (0.11 added a framing fact); compiler cases and size rules went in without a bump (#4, #5). Thecompiler/readme.mdcorpus table lists the group.Left for #11
Groups (
groupon a dependency entry, and regrouping), and the format kind of case for import ordering. They wait for core#284, and core's conformance runner would fail on them until then.Checked
specs/check.sh --checkis clean. Run against core with the rule (ComlineProject/core feat/own-schema-relative-paths): allimportscases and the rest pass.