macisamuele / language-formatters-pre-commit-hooks

Collection of custom pre-commit hooks.
Apache License 2.0
112 stars 56 forks source link

Always use UTF-8 for TOML files #208

Closed Jayman2000 closed 6 months ago

Jayman2000 commented 6 months ago

According to the TOML spec, “A TOML file must be a valid UTF-8 encoded Unicode document”. Before this commit, pretty-format-toml didn’t specify an encoding when opening TOML files. As a result, the character encoding used to decode TOML files depended on the user’s system configuration. This commit makes sure that TOML files are always decoded using UTF-8, regardless of how the user’s system is configured.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (64e5d0b) 100.00% compared to head (f9320ca) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #208 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 10 10 Lines 333 333 ========================================= Hits 333 333 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Jayman2000 commented 6 months ago

I tried to fix the one CI job that failed, but I don’t think that there’s anything that I can do. It looks like the failure was caused by a random HTTP 502 error from GitHub. I tried running test suite on my system with the same software versions (Windows 11, Go 1.19.3, Java 16 and Python 3.11), and it succeeded.

Is there anything that I need to do in order to fix this PR?

Edit: I just rebased my branch on master. We’ll see if this problem comes back.