Skip to content

feat(smarttags): v5 behavior spellings and unknown-token checks - #89

Merged
archlemon merged 1 commit into
mainfrom
feat/smarttags-v5
Nov 24, 2026
Merged

archlemon merged 1 commit into
mainfrom
feat/smarttags-v5

Conversation

@archlemon

Copy link
Copy Markdown
Member

Closes #86

What

  • smarttags.Tags.Omits maps the PostGraphile V5 @behavior spellings -filterBy and -orderBy (case-insensitive) onto the filter and order omit actions. The old -filter and -order stay as deprecated aliases.
  • smarttags.Tags.Check(Vocabulary) reports unknown @omit actions, unknown @behavior tokens and deprecated @behavior tokens, once per distinct token. The omit and contract tokens are always known. A product supplies its own @omit actions and any extra @behavior tokens through Vocabulary (pdbq passes its aggregates tokens, for example). Issue.Message and Issue.Attrs give both products the same log wording.
  • smartcomments/catalog.Check(cat, vocab) runs that check over every commented object in a catalog (tables and views, columns, constraints, composite fields, functions, enums, domains). Each Finding carries the object kind and its qualified name (Finding.Args gives the slog key-value pairs).

This moves the logic pdbq added locally in its PR 127 into pdbcore, so pdbq and pdbr read and warn about the same comments. The consumer PRs switch both products to this shared implementation.

Tests

  • go test -race ./..., go vet, golangci-lint
  • act lint-test

The change only adds API, so the downstream job should pass against pdbq and pdbr main.

The omit tokens of the behavior smart tag now include the PostGraphile V5
spellings -filterBy and -orderBy; -filter and -order stay as deprecated
aliases. Tags.Check reports unknown omit actions, unknown behavior tokens
and deprecated behavior tokens against a product's Vocabulary, and
smartcomments/catalog.Check runs it over every commented catalog object,
so pdbq and pdbr read and warn about the same comments.
@archlemon
archlemon merged commit ef6cc6e into main Nov 24, 2026
5 checks passed
@archlemon
archlemon deleted the feat/smarttags-v5 branch November 24, 2026 01:51
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.

smarttags: accept PostGraphile v5 behavior spellings and warn on unknown tokens

1 participant