Repository navigation
feat(smarttags): v5 behavior spellings and unknown-token checks - #89
Merged
Merged
Conversation
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.
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.
Closes #86
What
smarttags.Tags.Omitsmaps the PostGraphile V5@behaviorspellings-filterByand-orderBy(case-insensitive) onto thefilterandorderomit actions. The old-filterand-orderstay as deprecated aliases.smarttags.Tags.Check(Vocabulary)reports unknown@omitactions, unknown@behaviortokens and deprecated@behaviortokens, once per distinct token. The omit and contract tokens are always known. A product supplies its own@omitactions and any extra@behaviortokens throughVocabulary(pdbq passes its aggregates tokens, for example).Issue.MessageandIssue.Attrsgive 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). EachFindingcarries the object kind and its qualified name (Finding.Argsgives 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-lintlint-testThe change only adds API, so the
downstreamjob should pass against pdbq and pdbrmain.