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

Support whitespace after ParamSlash #713

Merged
merged 4 commits into from
Jun 26, 2022
Merged

Support whitespace after ParamSlash #713

merged 4 commits into from
Jun 26, 2022

Conversation

zsol
Copy link
Member

@zsol zsol commented Jun 22, 2022

Review stack (2/2) Prev


Summary

This PR introduces a new whitespace_after field to ParamSlash to represent whitespace after the / in signatures. Parsing for this new field is implemented in the native parser (enabled with LIBCST_PARSER_TYPE=native env var currently), but not the old pure python one.

Fixes #679.

Test Plan

Added roundtrip and unit tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 22, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #713 (44497de) into main (aa4a279) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #713   +/-   ##
=======================================
  Coverage   94.80%   94.80%           
=======================================
  Files         247      247           
  Lines       25710    25721   +11     
=======================================
+ Hits        24374    24385   +11     
  Misses       1336     1336           
Impacted Files Coverage Δ
libcst/_nodes/tests/test_lambda.py 100.00% <ø> (ø)
libcst/_nodes/expression.py 96.66% <100.00%> (+<0.01%) ⬆️
libcst/_nodes/tests/test_funcdef.py 87.23% <100.00%> (+0.56%) ⬆️
libcst/_typed_visitor.py 97.01% <100.00%> (+<0.01%) ⬆️
libcst/matchers/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa4a279...44497de. Read the comment docs.

@zsol zsol changed the title Posarg whitespace Support whitespace after ParamSlash Jun 22, 2022
@zsol zsol force-pushed the posarg-whitespace branch from 44497de to 76699d8 Compare June 22, 2022 14:09
@zsol zsol marked this pull request as ready for review June 22, 2022 14:18
@zsol zsol merged commit 9925117 into main Jun 26, 2022
@zsol zsol deleted the posarg-whitespace branch June 26, 2022 08:42
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 16, 2022
0.4.7 - 2022-07-12

Fixed
* Fix get_qualified_names_for matching on prefixes of the given name by @lpetre in Instagram/LibCST#719

Added
* Implement lazy loading mechanism for expensive metadata providers by @Chenguang-Zhu in Instagram/LibCST#720


0.4.6 - 2022-07-04

New Contributors
- @superbobry made their first contribution in Instagram/LibCST#702

Fixed
- convert_type_comments now preserves comments following type comments by @superbobry in Instagram/LibCST#702
- QualifiedNameProvider optimizations
  - Cache the scope name prefix to prevent scope traversal in a tight loop by @lpetre in Instagram/LibCST#708
  - Faster qualified name formatting by @lpetre in Instagram/LibCST#710
  - Prevent unnecessary work in Scope.get_qualified_names_for_ by @lpetre in Instagram/LibCST#709
- Fix parsing of parenthesized empty tuples by @zsol in Instagram/LibCST#712
- Support whitespace after ParamSlash by @zsol in Instagram/LibCST#713
- [parser] bail on deeply nested expressions by @zsol in Instagram/LibCST#718


0.4.5 - 2022-06-17

New Contributors

-   @zzl0 made their first contribution in Instagram/LibCST#704

Fixed

-   Only skip supported escaped characters in f-strings by @zsol in Instagram/LibCST#700
-   Escaping quote characters in raw string literals causes a tokenizer error by @zsol in Instagram/LibCST#668
-   Corrected a code example in the documentation by @zzl0 in Instagram/LibCST#703
-   Handle multiline strings that start with quotes by @zzl0 in Instagram/LibCST#704
-   Fixed a performance regression in libcst.metadata.ScopeProvider by @lpetre in Instagram/LibCST#698


0.4.4 - 2022-06-13

New Contributors

-   @adamchainz made their first contribution in Instagram/LibCST#688

Added

-   Add package links to PyPI by @adamchainz in Instagram/LibCST#688
-   native: add overall benchmark by @zsol in Instagram/LibCST#692
-   Add support for PEP-646 by @zsol in Instagram/LibCST#696

Updated

-   parser: use references instead of smart pointers for Tokens by @zsol in Instagram/LibCST#691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: positional arguments identifier (/) whitespace is not always stored
3 participants