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

Be proactive about encoding mismatch #575

Merged
merged 14 commits into from
May 21, 2020
Merged

Conversation

nedtwigg
Copy link
Member

As noted here, it is very destructive for Spotless to run an apply operation with an incorrect encoding set. If the encoding was incorrect, we should error loudly to prevent special characters from being changed.

This PR is just a draft - We can make the error message a lot better, and we can probably go faster by never re-encoding to an entire byte[], and instead just check against the existing byte[] as we go. That also makes it easier to create a good error message, especially for multibyte encodings like UTF-8.

@nedtwigg
Copy link
Member Author

If you've got time, I'd love your feedback @andrewfg

@nedtwigg nedtwigg marked this pull request as ready for review May 15, 2020 19:27
@nedtwigg nedtwigg merged commit aad37ce into master May 21, 2020
@nedtwigg nedtwigg deleted the feat/cautious-encoding branch May 21, 2020 16:27
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