Fix file handling of --all-files to properly handle non-ascii filenames. #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On my setup lintrunner was failing like this:
The underlying error was because there's a file with non-ascii characters in the name.
There are two problems:
gitwasn't found it was reporting the error without any context about the filename.gitare escaped bygitand then passed through a utf-8String.This PR adds context for the names so when an error does occur the user can at least tell what file had the problem.
Additionally it changes how
--all-filesgets its filenames so it doesn't pass them through String (which incorrectly does utf-8 encoding on them).There are some additional incorrect handling of paths in other areas of the code (
get_paths_from_cmdfor example) which should probably be fixed in a similar manner in the future (or maybe merged with the all-files handling).