Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make stripComments optional for syntax detection #217

Merged
merged 1 commit into from Jan 11, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 11, 2024

πŸ”— Linked issue

Complementary to #196 to avoid regressions

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Striping comments with regex is tricky. (see #56, #155 and added test in this PR -- thanks @danielroe for idea in #155 (comment)!)

This PR makes stripping comments for syntax detection utils so users can opt-in.

In the future (maybe major versions) we might migrate to a native parser.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (4ffc601) 87.02% compared to head (fc806e2) 86.86%.

Files Patch % Lines
src/syntax.ts 84.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
- Coverage   87.02%   86.86%   -0.17%     
==========================================
  Files           8        8              
  Lines        1010     1028      +18     
  Branches      165      168       +3     
==========================================
+ Hits          879      893      +14     
- Misses        131      135       +4     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@pi0 pi0 merged commit c29618f into main Jan 11, 2024
2 of 4 checks passed
@pi0 pi0 deleted the fix/syntax-strip-optin branch January 11, 2024 11:02
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.

None yet

1 participant