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

Fixing issues with comment extraction for the help string #148

Merged
merged 7 commits into from
Aug 24, 2024

Conversation

swansonk14
Copy link
Owner

This PR fixes two issues with comment extraction for the help string.

  1. From Escaped characters in docstring are over-escaped by the tokenizer #97, escaped quote characters (e.g., "\"") in the help string are incorrectly un-escaped.

This was fixed by using a bytes representation with an ascii encoding and a unicode-escape decoding.

  1. From [suggestion] Class variable arguments with multiline defaults do not respect help comments  #130, strings in multiline assign statements are parsed as comments rather than the true comment after the multiline assign statement.

Taking inspiration from #144, we the ast package to differentiate between strings belonging to an assign statement and strings intended as a comment for the help string. Thank you @arnaud-ma for the great idea!

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.

Project coverage is 93.49%. Comparing base (5257fe8) to head (3980c81).

Files Patch % Lines
src/tap/utils.py 82.35% 6 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
- Coverage   94.07%   93.49%   -0.59%     
==========================================
  Files           4        4              
  Lines         692      722      +30     
==========================================
+ Hits          651      675      +24     
- Misses         41       47       +6     

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

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.

3 participants