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

fix: escape backslashes in JSON formatter output #314

Closed

Conversation

jparise
Copy link
Member

@jparise jparise commented Mar 14, 2024

Motivation

Our JSON-formatted ouput is not actually valid JSON when it is rendered with unescaped backslashes like ".+@.+..+".

Proposed Changes

The JsonFormatter uses JSON.stringify() to render its output, but it needs additional postprocessing to escape backslashes.

Test Plan

I added a unit test to exercise this new expected behavior.

@jparise jparise requested a review from hyandell as a code owner March 14, 2024 18:26
Otherwise, our JSON-formatted ouput is not actually valid JSON when it
is rendered with unescaped backslashes like ".+@.+\..+".

Signed-off-by: Jon Parise <jon@indelible.org>
@jparise jparise force-pushed the json-formatter-escape-backslashes branch from 70527cd to 8db98b6 Compare March 14, 2024 18:27
@jparise
Copy link
Member Author

jparise commented Mar 14, 2024

Actually, scratch this. The problem I was seeing was due to some local, intermediate string processing that I had attributed to repolinter itself.

@jparise jparise closed this Mar 14, 2024
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