Skip to content

Conversation

@scottmries
Copy link
Contributor

@scottmries scottmries commented Oct 22, 2025

This pulls in changes from the fork, to let our tests run.

The changes look good to me, fwiw.

No QA required

@scottmries scottmries requested a review from a team as a code owner October 22, 2025 20:29
Copilot AI review requested due to automatic review settings October 22, 2025 20:29
Copy link

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 fixes string mutation issues in the axe-core-api results building logic by replacing in-place prepend operations with string interpolation, ensuring immutability of string objects.

  • Replaced line.prepend(" " * 4) with string interpolation in the indent method
  • Replaced line.prepend("- ") with string interpolation in the fix method

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/axe-core-api/lib/axe/api/results/rule.rb Updated indent method to use string interpolation instead of mutating strings with prepend
packages/axe-core-api/lib/axe/api/results/checked_node.rb Updated fix method to use string interpolation instead of mutating strings with prepend

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Garbee
Garbee previously requested changes Oct 22, 2025
Copy link
Member

@Garbee Garbee left a comment

Choose a reason for hiding this comment

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

I assume the fork is this one correct, https://github.com/G-Rath/axe-core-gems ?

  1. What bug is this fixing?
  2. This should have unit tests to ensure we don't regress in the future. Very subtle thing here, easy to miss when refactoring.

@scottmries
Copy link
Contributor Author

scottmries commented Oct 23, 2025

@Garbee

I assume the fork is this one correct, https://github.com/G-Rath/axe-core-gems ?

That's right. This is the original PR: #461

  1. What bug is this fixing?

It removes a warning about future deprecation of string mutation in Ruby 3.4, possibly breaking in a future release.

  1. This should have unit tests to ensure we don't regress in the future. Very subtle thing here, easy to miss when refactoring.

Both of these are private methods whose public uses would be unaffected, and string mutation is tested at the language level; if a future release breaks mutable strings, this will avoid that breakage. Thoughts on this?

Copy link
Member

@Garbee Garbee left a comment

Choose a reason for hiding this comment

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

Both of these are private methods whose public uses would be unaffected, and string mutation is tested at the language level; if a future release breaks mutable strings, this will avoid that breakage. Thoughts on this?

I see, from the original PR that explains how this came about. Deprecation message in Ruby itself. Ok, all good then. I was concerned since a consumer saw this and made a PR, that there was something they hit. But if it's purely driven by the language deprecation, then yea no unit tests needed on this. We don't have a scenario that was impacted.

LGTM.

@scottmries scottmries merged commit 7098219 into develop Oct 24, 2025
10 checks passed
@scottmries scottmries deleted the sr-G-Rath-patch-1 branch October 24, 2025 19:53
@github-actions github-actions bot mentioned this pull request Jan 9, 2026
straker added a commit that referenced this pull request Jan 12, 2026
##
[4.11.1](v4.11.0...v4.11.1)
(2026-01-09)


### Bug Fixes

* avoid mutating strings when building results
([#462](#462))
([7098219](7098219))
* Update axe-core to v4.11.1
([#463](#463))
([87632f5](87632f5))
@Amandeque Amandeque mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants