repobee / repobee-sanitizer

A plugin for sanitizing master repositories before distribution to students
MIT License
2 stars 3 forks source link

[fix] Guess file encodings to avoid encoding-related crashes #63

Closed slarse closed 4 years ago

slarse commented 4 years ago

Fix #59 Fix #55

This PR implements file encoding guessing. It's a pretty substantial refactoring as we need to keep track of both the file encoding and the filepath. We also now enforce that the paths used are relative with the RelativePath data structure, to avoid the mishap of #60

I've also noted that the file command that we use to guess encodings only gives ISO8859, which is not the full encoding. So we in fact do not have support for ISO8859-encoded files at the moment.

codecov[bot] commented 4 years ago

Codecov Report

Merging #63 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         7    +1     
  Lines          162       187   +25     
  Branches        28        31    +3     
=========================================
+ Hits           162       187   +25     
Impacted Files Coverage Δ
repobee_sanitizer/_fileutils.py 100.00% <100.00%> (ø)
repobee_sanitizer/_sanitize_repo.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 79d629a...d6c14ae. Read the comment docs.

slarse commented 4 years ago

@tohanss Done