Skip comments in regex brace matching#573
Conversation
|
Thanks for the fix. I accepted the underlying issue, but implemented it with changes on this branch in cfaf256 rather than merging this PR directly. Decision: IMPLEMENT_WITH_CHANGES. The fallback brace matchers now skip line and block comments for C#/C++/Dart, and Rust uses a nested block-comment depth counter so braces after an inner */ but before the outer */ are still ignored. I added regressions for the affected fallback extractors, including nested Rust comments. Validation: PYENV_VERSION=3.11.11 python -m pytest desloppify/languages/csharp/tests/test_csharp_parse_helpers.py desloppify/languages/cxx/tests/test_extractors.py desloppify/languages/dart/tests/test_extractors.py desloppify/languages/rust/tests/test_extractors.py desloppify/languages/typescript/tests/test_ts_fixers.py -q |
|
Closing as superseded by cfaf256 on the review branch. |
|
Thanks for the contribution. This is included in v1.0: https://github.com/peteromallet/desloppify/releases/tag/v1.0 |
Record co-author trailers for PR authors included in the v1.0 release cycle so GitHub can associate release-cycle contribution credit with the tag. Refs: #189, #484, #485, #486, #489, #493, #495, #529, #539, #573, #580, #581, #584, #585, #589, #602, #603 Co-authored-by: R. Desmond <134018026+0-CYBERDYNE-SYSTEMS-0@users.noreply.github.com> Co-authored-by: AreboursTLS <77301936+AreboursTLS@users.noreply.github.com> Co-authored-by: AugusteBalas <128148269+AugusteBalas@users.noreply.github.com> Co-authored-by: Alex Price <2804025+awprice@users.noreply.github.com> Co-authored-by: Klaus Agnoletti <24544601+klausagnoletti@users.noreply.github.com> Co-authored-by: Koshi <18751916+koshimazaki@users.noreply.github.com> Co-authored-by: Pietro <6080662+pietrondo@users.noreply.github.com> Co-authored-by: raveinid <7130195+raveinid@users.noreply.github.com> Co-authored-by: Ryan Gerstenkorn <4079939+RyanJarv@users.noreply.github.com> Co-authored-by: ryexLLC <217349586+ryexLLC@users.noreply.github.com> Co-authored-by: Maximilian Scholz <6530123+sims1253@users.noreply.github.com> Co-authored-by: Tristan Manchester <108270628+tristanmanchester@users.noreply.github.com>
Summary
/* ... */and// ...comment regions before counting bracesTesting
uv run --with pytest python -m pytest desloppify/languages/csharp/tests/test_csharp_parse_helpers.py desloppify/languages/cxx/tests/test_extractors.py desloppify/languages/rust/tests/test_extractors.py desloppify/languages/dart/tests/test_extractors.py