Skip to content

fix: escape literals in scan diff#1251

Merged
kriswest merged 2 commits intofinos:mainfrom
kriswest:1238-escape-literals-in-scanDiff
Oct 17, 2025
Merged

fix: escape literals in scan diff#1251
kriswest merged 2 commits intofinos:mainfrom
kriswest:1238-escape-literals-in-scanDiff

Conversation

@kriswest
Copy link
Copy Markdown
Contributor

@kriswest kriswest commented Oct 16, 2025

resolves #1238

Escapes string literals in scanDiff using the escape-string-regexp library, which has been adopted into es2025 to implement RegExp.escape(). RegExp.escape() is not yet supported in TypeScript and requires at least node24 or chromium 138, hence, I've gone with the dependency for now and left a note to replace it when we move to requiring node24.

Adjusted the relevant test to include regex syntax so that it will fail if not correctly escaped.

@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 16, 2025

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 675a692
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/68f2313b04c1930008d7787c

@kriswest kriswest requested a review from coopernetes October 16, 2025 09:39
@kriswest kriswest changed the title 1238 escape literals in scan diff fix: escape literals in scan diff Oct 16, 2025
@github-actions github-actions Bot added the fix label Oct 16, 2025
@kriswest
Copy link
Copy Markdown
Contributor Author

@coopernetes assigned you for review as you mentioned needing to use this soon. Literals in commit messages are handled differently (as per the issue) (case insensitve substring match, as opposed to case insensitive regex match)

@kriswest kriswest force-pushed the 1238-escape-literals-in-scanDiff branch from b5dafb5 to 5f44579 Compare October 16, 2025 09:49
@kriswest kriswest force-pushed the 1238-escape-literals-in-scanDiff branch from 5f44579 to 15f8999 Compare October 16, 2025 09:52
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.40%. Comparing base (13ee734) to head (675a692).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1251   +/-   ##
=======================================
  Coverage   83.39%   83.40%           
=======================================
  Files          70       70           
  Lines        3006     3007    +1     
  Branches      501      501           
=======================================
+ Hits         2507     2508    +1     
  Misses        396      396           
  Partials      103      103           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kriswest kriswest requested a review from jescalada October 17, 2025 11:25
Signed-off-by: Kris West <kristopher.west@natwest.com>
Copy link
Copy Markdown
Contributor

@coopernetes coopernetes left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@kriswest kriswest merged commit 6ea37c1 into finos:main Oct 17, 2025
14 checks passed
@kriswest kriswest deleted the 1238-escape-literals-in-scanDiff branch October 17, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blocked string literals in commitConfig.diff.block.literals incorrectly handled as RegExp

2 participants