Skip to content

Comments

refactor(linter): reduce repeated logic in JS plugin linting#17086

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/12-18-refactor_linter_reduce_repeated_logic_in_js_plugin_linting
Dec 18, 2025
Merged

refactor(linter): reduce repeated logic in JS plugin linting#17086
graphite-app[bot] merged 1 commit intomainfrom
om/12-18-refactor_linter_reduce_repeated_logic_in_js_plugin_linting

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 18, 2025

Follow-on after #17013. Pure refactor. Move logic for getting AllocatorPool into a function js_allocator_pool, to avoid lots of #[cfg] stuff.

Copy link
Member Author

overlookmotel commented Dec 18, 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
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 refactors the JS plugin linting code to eliminate duplicated conditional compilation logic. The main change introduces a helper method js_allocator_pool() that centralizes the platform-specific logic for retrieving the AllocatorPool, replacing multiple scattered #[cfg] attribute blocks.

  • Introduces js_allocator_pool() method to encapsulate conditional compilation logic
  • Removes duplicate #[cfg] blocks from two call sites (lines 641-646 and 760-762)
  • Simplifies method calls to run_with_disable_directives() by using the new helper

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

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging #17086 will not alter performance

Comparing om/12-18-refactor_linter_reduce_repeated_logic_in_js_plugin_linting (9a293a2) with om/12-18-refactor_allocator_simplify_return_type_of_fixedsizeallocatorpool_create_new_allocator_ (5fb89fb)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel self-assigned this Dec 18, 2025
@overlookmotel overlookmotel added the A-linter-plugins Area - Linter JS plugins label Dec 18, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 18, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 18, 2025

Merge activity

Follow-on after #17013. Pure refactor. Move logic for getting `AllocatorPool` into a function `js_allocator_pool`, to avoid lots of `#[cfg]` stuff.
@graphite-app graphite-app bot force-pushed the om/12-18-refactor_allocator_simplify_return_type_of_fixedsizeallocatorpool_create_new_allocator_ branch from 5fb89fb to 73c9ebf Compare December 18, 2025 23:45
@graphite-app graphite-app bot force-pushed the om/12-18-refactor_linter_reduce_repeated_logic_in_js_plugin_linting branch from 9a293a2 to 61f2138 Compare December 18, 2025 23:45
graphite-app bot pushed a commit that referenced this pull request Dec 18, 2025
Fix a typo that I introduced in #17086.
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 18, 2025
Base automatically changed from om/12-18-refactor_allocator_simplify_return_type_of_fixedsizeallocatorpool_create_new_allocator_ to main December 18, 2025 23:52
@graphite-app graphite-app bot merged commit 61f2138 into main Dec 18, 2025
21 checks passed
@graphite-app graphite-app bot deleted the om/12-18-refactor_linter_reduce_repeated_logic_in_js_plugin_linting branch December 18, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant