Skip to content

test(linter/plugins): test fixes and suggestions at very end of file#19054

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-06-test_linter_plugins_test_fixes_and_suggestions_at_very_end_of_file
Feb 6, 2026
Merged

test(linter/plugins): test fixes and suggestions at very end of file#19054
graphite-app[bot] merged 1 commit intomainfrom
om/02-06-test_linter_plugins_test_fixes_and_suggestions_at_very_end_of_file

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 6, 2026

Alter test fixtures for fixes and suggestions.

Remove trailing newline from end of fixture files, so that the last fix the plugin makes is at very end of file - makes sure fixes in this position still work.

Add checks to these tests and also the BOM test to catch if these fixture files accidentally get formatted, which would add a trailing newline and prevent the tests testing what they should do.

Copy link
Member Author

overlookmotel commented Feb 6, 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 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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Feb 6, 2026
@github-actions github-actions bot added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label Feb 6, 2026
@overlookmotel overlookmotel marked this pull request as ready for review February 6, 2026 11:37
Copilot AI review requested due to automatic review settings February 6, 2026 11:37
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 enhances test fixtures for the oxlint plugin system by ensuring that fixes and suggestions can be properly tested when applied at the very end of a file (without trailing newlines). The changes add safeguards to prevent accidental formatting of these special test fixtures.

Changes:

  • Added formatter exclusions for fixture file directories to prevent automatic formatting
  • Added runtime assertions in test plugins to detect if fixture files have been accidentally formatted
  • Updated test fixtures and snapshots to remove trailing newlines

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
oxfmtrc.jsonc Excludes fixes and suggestions fixture directories from auto-formatting
apps/oxlint/test/fixtures/suggestions/plugin.ts Adds assertion to detect accidental formatting of fixtures
apps/oxlint/test/fixtures/suggestions/fix-suggestions.snap.md Updates snapshot to reflect fixture without trailing newline
apps/oxlint/test/fixtures/suggestions/files/index.js Removes trailing newline to test suggestions at EOF
apps/oxlint/test/fixtures/fixes/plugin.ts Adds assertion to detect accidental formatting of fixtures
apps/oxlint/test/fixtures/fixes/fix.snap.md Updates snapshot to reflect fixture without trailing newline
apps/oxlint/test/fixtures/fixes/files/index.js Removes trailing newline to test fixes at EOF
apps/oxlint/test/fixtures/bom/plugin.ts Adds assertion to detect accidental formatting of fixtures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2026

Merge activity

…19054)

Alter test fixtures for fixes and suggestions.

Remove trailing newline from end of fixture files, so that the last fix the plugin makes is at very end of file - makes sure fixes in this position still work.

Add checks to these tests and also the BOM test to catch if these fixture files accidentally get formatted, which would add a trailing newline and prevent the tests testing what they should do.
@graphite-app graphite-app bot force-pushed the om/02-05-test_linter_plugins_reduce_nesting_in_test_plugin_code branch from 3cde087 to a8ae9a9 Compare February 6, 2026 12:57
@graphite-app graphite-app bot force-pushed the om/02-06-test_linter_plugins_test_fixes_and_suggestions_at_very_end_of_file branch from bd47dc4 to d8055fe Compare February 6, 2026 12:58
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 6, 2026
Base automatically changed from om/02-05-test_linter_plugins_reduce_nesting_in_test_plugin_code to main February 6, 2026 13:04
@graphite-app graphite-app bot merged commit d8055fe into main Feb 6, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/02-06-test_linter_plugins_test_fixes_and_suggestions_at_very_end_of_file branch February 6, 2026 13:05
graphite-app bot pushed a commit that referenced this pull request Feb 6, 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