Skip to content

Comments

fix(linter): rule unicorn/escape-case#9585

Closed
therewillbecode wants to merge 2 commits intooxc-project:mainfrom
therewillbecode:fix/unicorn-escape-case
Closed

fix(linter): rule unicorn/escape-case#9585
therewillbecode wants to merge 2 commits intooxc-project:mainfrom
therewillbecode:fix/unicorn-escape-case

Conversation

@therewillbecode
Copy link
Contributor

Fixes #9583

Remove the unwraps from the rule so panics cannot happen.

@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 7, 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.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Mar 7, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 7, 2025

CodSpeed Performance Report

Merging #9585 will not alter performance

Comparing therewillbecode:fix/unicorn-escape-case (8b55a9f) with main (e3c2015)

Summary

✅ 39 untouched benchmarks

Copy link
Contributor

@shulaoda shulaoda left a comment

Choose a reason for hiding this comment

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

Could you add the related test case?

@therewillbecode
Copy link
Contributor Author

therewillbecode commented Mar 9, 2025

Could you add the related test case?

I probably shouldn't have said this PR fixes the issue in hindsight since I failed to reproduce the bug because the given example in the issue had the missing characters stripped from it by Github.

Should I just change the title of this PR to a refactor and not reference the issue?

@shulaoda
Copy link
Contributor

Should I just change the title of this PR to a refactor and not reference the issue?

Sorry, this is an issue I introduced. I have fixed it in #9638.

graphite-app bot pushed a commit that referenced this pull request Mar 10, 2025
closes #9583, #9585

Related to #9568

This is a regression issue caused by my refactoring. I have fixed it and added corresponding test cases.
@shulaoda shulaoda closed this Mar 10, 2025
@therewillbecode
Copy link
Contributor Author

@shulaoda Would it be useful to introduce the changes in this PR anyway since they remove unsafe .unwraps?

@shulaoda
Copy link
Contributor

shulaoda commented Mar 10, 2025

@shulaoda Would it be useful to introduce the changes in this PR anyway since they remove unsafe .unwraps?

The loop for _ in 0..count { and the is_hex check already guarantee the existence of the element, making let Some(..) = iter.next() unnecessary.

@therewillbecode therewillbecode deleted the fix/unicorn-escape-case branch April 11, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic called Option::unwrap() on a None value in unicorn/escape_case rule

3 participants