build(linter/plugins): add conformance build#16751
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new CONFORMANCE build flag to separate conformance-testing-specific code paths from general debug assertions. Previously, conformance testing code was guarded by if (DEBUG), meaning debug builds contained extra code that wasn't in release builds. The new approach ensures that regular debug builds are closer to release builds (differing only in debug assertions), while conformance builds include both debug assertions and conformance-specific test harness modifications.
Key Changes:
- Introduced
CONFORMANCEglobal constant alongsideDEBUG, whereCONFORMANCE=trueimpliesDEBUG=true - Updated conformance-specific code guards from
if (DEBUG)toif (CONFORMANCE)in RuleTester - Added new
build-conformancescript and updated conformance testing documentation
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxlint/vitest.config.ts | Defines CONFORMANCE: "false" for regular tests (which still have DEBUG: "true") |
| apps/oxlint/tsdown.config.ts | Adds logic to parse CONFORMANCE env var and makes DEBUG true when CONFORMANCE is true; defines both flags in build |
| apps/oxlint/src-js/package/rule_tester.ts | Updates conformance-specific code paths to use CONFORMANCE flag instead of DEBUG (test case modification hooks and error wrapping) |
| apps/oxlint/src-js/globals.d.ts | Adds TypeScript declaration for CONFORMANCE global constant with documentation |
| apps/oxlint/package.json | Adds build-conformance script that sets CONFORMANCE=true during build |
| apps/oxlint/conformance/README.md | Updates setup instructions to use build-conformance instead of build-test |
No issues were identified in the changed code. The implementation is clean, consistent, and well-documented. The separation of concerns between debug assertions and conformance-specific behavior is architecturally sound.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
6342619 to
4f9d17f
Compare
Supporting conformance testing is requiring adding extra code paths to `RuleTester` and main JS plugins code. Previously, these paths were guarded by `if (DEBUG)` branches, so the extra code is not in release build. But ideally we don't want this code in debug build either, so the tests are testing a build that's identical to release build, except for enabling debug assertions. Introduce a new build specifically for conformance testing, and gate code specific to conformance testing with `if (CONFORMANCE)` instead of `if (DEBUG)`.
3c42c4b to
e401961
Compare
Supporting conformance testing is requiring adding extra code paths to `RuleTester` and main JS plugins code. Previously, these paths were guarded by `if (DEBUG)` branches, so the extra code is not in release build. But ideally we don't want this code in debug build either, so the tests are testing a build that's identical to release build, except for enabling debug assertions. Introduce a new build specifically for conformance testing, and gate code specific to conformance testing with `if (CONFORMANCE)` instead of `if (DEBUG)`.
e401961 to
5723f3d
Compare

Supporting conformance testing is requiring adding extra code paths to
RuleTesterand main JS plugins code.Previously, these paths were guarded by
if (DEBUG)branches, so the extra code is not in release build. But ideally we don't want this code in debug build either, so the tests are testing a build that's identical to release build, except for enabling debug assertions.Introduce a new build specifically for conformance testing, and gate code specific to conformance testing with
if (CONFORMANCE)instead ofif (DEBUG).