-
Notifications
You must be signed in to change notification settings - Fork 43
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
Handle headers in code comments #2285
Conversation
Is #2260 also fixed by this? |
4bdeccf
to
5c24869
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2285 +/- ##
==========================================
+ Coverage 56.71% 56.76% +0.05%
==========================================
Files 361 361
Lines 49547 49745 +198
==========================================
+ Hits 28099 28238 +139
- Misses 19906 19954 +48
- Partials 1542 1553 +11 ☔ View full report in Codecov by Sentry. |
I doubt it. This change is only concerned with correctly parsing |
405b544
to
b366ae8
Compare
b366ae8
to
128cbe1
Compare
28ab284
to
1145b5e
Compare
This is a pre-requisite for pulumi/pulumi-terraform-bridge#2285. pulumi/pulumi-terraform-bridge#2285 uses a real markdown parser. This correctly identifies `Collection of resources to manage IAM policy for Dataproc AutoscalingPolicy` as a H2 header, just like GH does. ```md --- # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** Type: MMv1 *** # # ---------------------------------------------------------------------------- # # This file is automatically generated by Magic Modules and manual # changes will be clobbered when the file is regenerated. # # Please read more about how to change this file in # .github/CONTRIBUTING.md. # # ---------------------------------------------------------------------------- ## subcategory: "Dataproc" description: |- Collection of resources to manage IAM policy for Dataproc AutoscalingPolicy --- ``` This PR removes the second front-matter from the copied doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we can merge. I like that we've removed groupLines
as well.
Correctly handle "markdown headers" in code blocks. We do this by using goldmark to parse the markdown and find headers of the right type, then use byte offsets to extract from the original text.
This allows us to correctly parse comments like:
Fixes pulumi/pulumi-snowflake#683
I have tested this in aws, gcp, azure, cloudflare and snowflake. Snowflake fixes a great number of resources, gcp is broken due to a bad doc rewrite rule (which I will fix before merging here). The rest are unchanged.
I think we are ready to merge.