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

Replace string manipulation with AST logic in parseArgReferenceSection #2318

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

guineveresaenger
Copy link
Contributor

@guineveresaenger guineveresaenger commented Aug 16, 2024

Uses Goldmark to extract information for docs descriptions from Markdown nodes, specifically:

  • ListItem
  • top-level Pragraph
  • Section Headings

This PR preserves the logic of tracking a docs path via number of subfields for later lookup, and assigning it a description.
It also attempts to keep all of the docs parsing details of before.

This code is adjusting the azurerm-sql-firewall-rule test because it doesn't yet preserve the **NOTE** inside of an argument description. (Arguably, this NOTE should not actually be part of an argument field - it should exist on its own as part of the Section.)

Additionally, H4 headers are now correctly nested under H3 headers. The example for the TestArgumentRegex/Parses_H3_and_H4_headers_and_their_bullets_as_nested_properties test
is taken from here and it should in fact be nested in the way the new changes reflect. Ultimately for docsgen it doesn't seem to make a difference, but it is nice to see that structures are preserved.

Currently there's a few subheading patterns that aren't carried over to the new parser quite correctly.

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.00%. Comparing base (5548bd6) to head (45847da).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2318      +/-   ##
==========================================
+ Coverage   56.85%   57.00%   +0.15%     
==========================================
  Files         364      365       +1     
  Lines       49910    49943      +33     
==========================================
+ Hits        28374    28470      +96     
+ Misses      19990    19919      -71     
- Partials     1546     1554       +8     

☔ 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.

1 participant