Skip to content

Document and hint qualified entity references - #59

Open
StevenACoffman wants to merge 3 commits into
stacklok:mainfrom
StevenACoffman:lint-qualified-entity-hints
Open

StevenACoffman wants to merge 3 commits into
stacklok:mainfrom
StevenACoffman:lint-qualified-entity-hints

Conversation

@StevenACoffman

@StevenACoffman StevenACoffman commented Oct 12, 2026 •

Copy link
Copy Markdown

Hi! Thanks for making cool stuff. I noticed a few skills were stale, and some of the lint messages, so I spruced them up a bit.

ADR-0018 (7aa1f40) made scope.Entity valid in relationship.entity and subtypeOf, but some text still described the older, enum-only behavior:

  • Skills. domain-model-author said entity references can't be qualified, and domain-model-lint called them a structural error. Both now describe what's supported, note that checks stop at the import boundary, and list the semantic error for an unresolved scope.Entity.
  • Lint message. The unused-import warning told authors only to reference an enum in an attribute type. It now offers the entity form too, and the test asserts the full hint.
  • Schema reference. "The two nothing-references-it checks" followed a list of three. It now names the two that shared: true relaxes (unused glossary term, unused enum) and says the unused-import check still applies, which is what the code does.

task check steps all pass locally (vet, staticcheck, golangci-lint v2.12.2, tests, model lint, render-check, plugin validate).

The warning for an import nothing references still said to reference
one of its enums in an attribute type. Since ADR-0018, an imported
entity can also be referenced as scope.Entity in a relationship or
subtypeOf, so the hint now offers both. The test asserts the full hint
rather than only "is never referenced".

Signed-off-by: Steve Coffman <steve@khanacademy.org>
domain-model-author said relationship.entity and subtypeOf cannot be
qualified, and domain-model-lint called that a structural error. Both
predate ADR-0018 (7aa1f40), which made scope.Entity valid there. Say
what is supported, note that checks stop at the import boundary, and
list the semantic error for an unresolved scope.Entity.

Signed-off-by: Steve Coffman <steve@khanacademy.org>
"The two nothing-references-it checks" followed a list of three. The
linter relaxes the unused glossary term and unused enum checks for a
shared model, but still warns on an unused import.

Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman
StevenACoffman requested a review from jbeda as a code owner October 12, 2026 16:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant