Skip to content

Add internal query linter#708

Open
simonmar wants to merge 1 commit intofacebookincubator:mainfrom
simonmar:query-lint
Open

Add internal query linter#708
simonmar wants to merge 1 commit intofacebookincubator:mainfrom
simonmar:query-lint

Conversation

@simonmar
Copy link
Copy Markdown
Collaborator

(mostly written by Claude Opus 4.6)

When working on the compiler it's easy to accidentally break something that results in a segfault. Most of these errors can be detected by checks on the Codegen IR, in particular correct type-safety and variable-scoping.

  • Add Glean.Query.Lint to implement query consistency checks
  • Turn on query linting with GLEAN_DEBUG=lint or --debug-query-lint
  • Linting is automatically enabled for all tests via withTestEnv

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 25, 2026

Deploy Preview for fb-oss-glean ready!

Name Link
🔨 Latest commit 0e61d2f
🔍 Latest deploy log https://app.netlify.com/projects/fb-oss-glean/deploys/69e89aa4386fb500083778a8
😎 Deploy Preview https://deploy-preview-708--fb-oss-glean.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 25, 2026
Comment thread glean/db/Glean/Query/Lint.hs
Copy link
Copy Markdown

@josefs josefs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by review

@simonmar simonmar force-pushed the query-lint branch 3 times, most recently from 8df1387 to 2e0f777 Compare March 26, 2026 17:30
@simonmar simonmar marked this pull request as ready for review March 26, 2026 20:49
When working on the compiler it's easy to accidentally break something
that results in a segfault. Most of these errors can be detected by
checks on the Codegen IR, in particular correct type-safety and
variable-scoping.

- Add Glean.Query.Lint to implement query consistency checks
- Turn on query linting with `GLEAN_DEBUG=lint` or `--debug-query-lint`
- Linting is automatically enabled for all tests via `withTestEnv`
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 23, 2026

@simonhollis has imported this pull request. If you are a Meta employee, you can view this in D102147954.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants