Open dscorbett opened 6 hours ago
or the check should not report a violation.
I'd vote for this option. The rule's purpose is to flag unnecessary UTF-8 encoding declarations. Clearly in some cases it's erroneously flagging encodings which are, in fact, necessary :-)
The fix for
utf8-encoding-declaration
(UP009) in Ruff 0.8.1 changes the file’s declared encoding when the redundant UTF-8 encoding declaration is followed by a non-UTF-8 encoding declaration. In that case, the UTF-8 declaration is not completely redundant, because it blocks the following declaration from having an effect. The fix should insert up to 2 blank lines so the other declarations have no effect, or the fix should delete the other declarations, or the check should not report a violation.Example of a syntax error:
Example of changed behavior: