Skip to content

SEC-283: Remove extra whitespace after prefix when writing comments#241

Closed
Arvind Thirunarayanan (arvindth) wants to merge 1 commit into
confluentinc:masterfrom
arvindth:ath-SEC-283-removeSpaceAfterPrefix
Closed

SEC-283: Remove extra whitespace after prefix when writing comments#241
Arvind Thirunarayanan (arvindth) wants to merge 1 commit into
confluentinc:masterfrom
arvindth:ath-SEC-283-removeSpaceAfterPrefix

Conversation

@arvindth

Copy link
Copy Markdown
Member

From SEC-283, it looks like we don't want the extra whitespace added after comment prefixes. If that is the only issue, then this change will fix it. Before this change:

#comment1
a=b
# comment2
c=d

would change to

# comment1
a=b
# comment2
c=d

After this change though, the original file would change to:

#comment1
a=b
#comment2
c=d

Note that although comment1 has retained its original spacing, the whitespace between comment2 and its prefix gets stripped out. To retain and passthrough all such formatting would require additional changes to the underlying properties parser library.

@DABH David Hyde (DABH) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like the real ask here would be to not change commented lines at all. But if this change results in fewer changes than the current state, then sounds good to me.

@arvindth

Copy link
Copy Markdown
Member Author

I've posted a PR to preserve whitespace on all commented lines to the upstream library magiconair/properties. I've also made corresponding changes on my cli branch.

If this PR isn't enough, then once the upstream accepts my preserveFormatting changes, I'll post my branch as a PR.

@DABH

Copy link
Copy Markdown
Contributor

Arvind Thirunarayanan (@arvindth) oh cool, yeah this is what we talked about on slack, I see ; ) Sounds good -- we can wait a few days and see if they accept the PR

@arvindth

Copy link
Copy Markdown
Member Author

Closing due to a more comprehensive fix in PR #260

@arvindth Arvind Thirunarayanan (arvindth) deleted the ath-SEC-283-removeSpaceAfterPrefix branch December 9, 2019 22:36
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.

2 participants