Skip to content

build(linter/plugins): add conformance build#16751

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-11-build_linter_plugins_add_conformance_build
Dec 11, 2025
Merged

build(linter/plugins): add conformance build#16751
graphite-app[bot] merged 1 commit intomainfrom
12-11-build_linter_plugins_add_conformance_build

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 11, 2025

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).

Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 CONFORMANCE global constant alongside DEBUG, where CONFORMANCE=true implies DEBUG=true
  • Updated conformance-specific code guards from if (DEBUG) to if (CONFORMANCE) in RuleTester
  • Added new build-conformance script 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.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Dec 11, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 12-11-perf_linter_plugins_remove_unnecessary_check branch from 6342619 to 4f9d17f Compare December 11, 2025 13:10
graphite-app bot pushed a commit that referenced this pull request Dec 11, 2025
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)`.
@graphite-app graphite-app bot force-pushed the 12-11-build_linter_plugins_add_conformance_build branch from 3c42c4b to e401961 Compare December 11, 2025 13:10
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Base automatically changed from 12-11-perf_linter_plugins_remove_unnecessary_check to main December 11, 2025 13:16
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
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)`.
@graphite-app graphite-app bot force-pushed the 12-11-build_linter_plugins_add_conformance_build branch from e401961 to 5723f3d Compare December 11, 2025 14:29
@graphite-app graphite-app bot merged commit 5723f3d into main Dec 11, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-11-build_linter_plugins_add_conformance_build branch December 11, 2025 14:36
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants