Skip to content

tools/template-check: add func-check subcommand and core logic#18371

Open
vr-ibm wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
vr-ibm:add-func-check-logic
Open

tools/template-check: add func-check subcommand and core logic#18371
vr-ibm wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
vr-ibm:add-func-check-logic

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Description
This is Part 1 of a stacked PR series to introduce a template function validator. This PR adds the core regex engine and the CLI subcommand.
Currently, using an invalid function (like BigQueryBasePath in a handwritten .go.tmpl file) only surfaces as a compilation error after ~20 minutes of CI. This linter catches those errors in <1s by validating against all registered mmv1 template functions.
Changes:

  • Added gotemplate.CheckInvalidFuncsForFile logic to scan .tmpl files for unknown functions.
  • Added template-check func-check subcommand to the CLI for local development.
  • Added basic unit tests to verify core functionality.
    Note: To keep the review manageable (<250 lines), the comprehensive test suite and CI integration will follow in subsequent PRs.
    Release Note Template for Downstream PRs (will be copied)
    See Write release notes for guidance.

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 23, 2026
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 4903a25:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@vr-ibm
vr-ibm marked this pull request as ready for review July 23, 2026 19:57
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.

2 participants