adrienverge / yamllint

A linter for YAML files.
GNU General Public License v3.0
2.79k stars 265 forks source link

Automatically detect character encoding of YAML files and ignore files #630

Open Jayman2000 opened 6 months ago

Jayman2000 commented 6 months ago

This PR makes sure that yamllint never uses open()’s default encoding. Specifically, it uses the character encoding detection algorithm specified in chapter 5.2 of the YAML spec when reading both YAML files and files that are on the ignore-from-file list.

There are two other PRs that are similar to this one. Here’s how this PR compares to those two:

Fixes #218. Fixes #238. Fixes #347. Closes #240. Closes #581.

coveralls commented 6 months ago

Coverage Status

coverage: 99.835% (+0.01%) from 99.825% when pulling d562b6bc08ff17ebd95e1edf2edd34b3a230e7b7 on Jayman2000:auto-detect-encoding into 99fb29aead7940470938fddb35f80300dfe18d69 on adrienverge:master.

Jayman2000 commented 5 months ago

I just noticed that one of the checks for this PR is failing. The coverage for yamllint/config.py went down, but that’s just because the total number relevant lines went down. There’s only two lines that aren’t covered, but those same two lines aren’t covered in the master branch. Is there anything that I need to do here?

adrienverge commented 5 months ago

Is there anything that I need to do here?

At the moment, no. I'm sorry, please excuse the delay, this is a big change with much impact, I need a large time slot to review this, which I couldn't find yet.