Skip to content

Handle inline comments - #3

Draft
adammw wants to merge 7 commits into
wantedly:masterfrom
adammw:adammw/inline-comments
Draft

Handle inline comments#3
adammw wants to merge 7 commits into
wantedly:masterfrom
adammw:adammw/inline-comments

Conversation

@adammw

@adammw adammw commented Aug 1, 2024

Copy link
Copy Markdown

What

Allows psych-comments gem to parse inline comments and round-trip them back to exported YAML

Example:

fruits: # don't add more than 5
- apples
- bananas
- tomatoes # requires some explanation

Why

Mostly because I didn't see that this had already been attempted in #2 😓 and was looking to use this feature in a custom linter/fixer, but the reformatting of inline comments was a deal-breaker.

Tasks

  • Review problems with previous attempt to ensure same issues are not present here
  • Support inline comments on first line of flow-style mapping/sequence
{ # an inline comment here is not supported
  foo: bar # here is
 } # as is here
  • Fix duplicated inline comments on flow mapping/sequences

@adammw
adammw force-pushed the adammw/inline-comments branch 2 times, most recently from a19fb56 to 2eeeb3c Compare August 1, 2024 02:09
@adammw
adammw marked this pull request as draft August 1, 2024 02:18
@adammw
adammw force-pushed the adammw/inline-comments branch 2 times, most recently from b6e4ec2 to ca16b99 Compare August 1, 2024 02:24
@adammw
adammw force-pushed the adammw/inline-comments branch from ca16b99 to b8cca85 Compare August 1, 2024 02:39
adrienpoly added a commit to adrienpoly/psych-comments that referenced this pull request Mar 4, 2025
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