You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, unit tests fail on windows runners, specifically for the trailing whitespace tests. This occured for the recent changes made to fix issues with resolving symlinks. The Path call in _normalize_path retains whitespaces on Linux, but removes them on Windows.
A simple (but not elegant) fix I found was to re-apply the trailing whitespace on windows systems.
# At bottom of filedef_count_trailing_whitespace(text: str):
count=0forcharinreversed(str(text)):
ifchar.isspace():
count+=1else:
breakreturncount
# In IgnoreRuledefmatch(self, abs_path):
"""Returns True or False if the path matches the rule."""matched=Falseifself.base_path:
rel_path=str(_normalize_path(abs_path).relative_to(self.base_path))
else:
rel_path=str(_normalize_path(abs_path))
# Path() strips trailing spaces on windowsifsys.platform.startswith('win'):
rel_path+=" "*_count_trailing_whitespace(abs_path)
# Path() strips the trailing slash, so we need to preserve it# in case of directory-only negationifself.negationandisinstance(abs_path, str) andabs_path[-1] =='/':
rel_path+='/'ifrel_path.startswith('./'):
rel_path=rel_path[2:]
ifre.search(self.regex, rel_path):
matched=Truereturnmatched
The text was updated successfully, but these errors were encountered:
Hello, unit tests fail on windows runners, specifically for the trailing whitespace tests. This occured for the recent changes made to fix issues with resolving symlinks. The
Path
call in_normalize_path
retains whitespaces on Linux, but removes them on Windows.A simple (but not elegant) fix I found was to re-apply the trailing whitespace on windows systems.
The text was updated successfully, but these errors were encountered: