Skip to content

test(linter/plugins): run rules in predictable order in tests#20165

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-09-test_linter_plugins_run_rules_in_predictable_order_in_tests
Mar 10, 2026
Merged

test(linter/plugins): run rules in predictable order in tests#20165
graphite-app[bot] merged 1 commit intomainfrom
om/03-09-test_linter_plugins_run_rules_in_predictable_order_in_tests

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 10, 2026

In tests, run rules in a predictable order (the order they're defined in config).

This makes it possible to control in tests with multiple rules in what order they run, which makes the tests in next 2 PRs (#20166, #20167) feasible.

Copy link
Member Author

overlookmotel commented Mar 10, 2026


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 changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Mar 10, 2026
@overlookmotel overlookmotel marked this pull request as ready for review March 10, 2026 00:47
@overlookmotel overlookmotel requested a review from camc314 as a code owner March 10, 2026 00:47
Copilot AI review requested due to automatic review settings March 10, 2026 00:47
Copy link
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 aims to make JS-plugin rule execution order deterministic during tests, enabling multi-rule tests to reliably depend on rule run ordering.

Changes:

  • In lintFileImpl, reorder the (ruleIds, optionsIds) pairs under DEBUG to enforce a stable rule execution order.
  • Preserve correct Rust-side diagnostic mapping by setting each rule’s ruleIndex to the original (pre-sort) position.

@overlookmotel overlookmotel self-assigned this Mar 10, 2026
@overlookmotel overlookmotel force-pushed the om/03-09-test_linter_plugins_run_rules_in_predictable_order_in_tests branch from fdb28de to 425b8be Compare March 10, 2026 01:16
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 10, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 10, 2026

Merge activity

In tests, run rules in a predictable order (the order they're defined in config).

This makes it possible to control in tests with multiple rules in what order they run, which makes the tests in next 2 PRs (#20166, #20167) feasible.
@graphite-app graphite-app bot force-pushed the om/03-09-test_linter_plugins_run_rules_in_predictable_order_in_tests branch from 425b8be to 3dabb8e Compare March 10, 2026 01:46
@graphite-app graphite-app bot merged commit 3dabb8e into main Mar 10, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/03-09-test_linter_plugins_run_rules_in_predictable_order_in_tests branch March 10, 2026 01:58
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 10, 2026
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 C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants