New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for user-defined mypy plugins #3517

Merged
merged 6 commits into from Jun 13, 2017
Jump to file or symbol
Failed to load files and symbols.
+6 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Attempt to fix path normalization in test cases in Windows

Previously we sometimes normalized to Windows paths and sometimes
to Linux paths. Now switching to always use Linux paths.
  • Loading branch information...
JukkaL committed Jun 9, 2017
commit d75842ce8268ad4a24114c2aa50ebc7e2464bb61
View
@@ -455,16 +455,17 @@ def expand_errors(input: List[str], output: List[str], fnam: str) -> None:
def fix_win_path(line: str) -> str:
r"""Changes paths to Windows paths in error messages.
r"""Changes Windows paths to Linux paths in error messages.
E.g. foo/bar.py -> foo\bar.py.
E.g. foo\bar.py -> foo/bar.py.
"""
line = line.replace(root_dir, root_dir.replace('\\', '/'))
m = re.match(r'^([\S/]+):(\d+:)?(\s+.*)', line)
if not m:
return line
else:
filename, lineno, message = m.groups()
return '{}:{}{}'.format(filename.replace('/', '\\'),
return '{}:{}{}'.format(filename.replace('\\', '/'),
lineno or '', message)
View
@@ -262,7 +262,8 @@ def find_error_paths(self, a: List[str]) -> Set[str]:
for line in a:
m = re.match(r'([^\s:]+):\d+: error:', line)
if m:
p = m.group(1).replace('/', os.path.sep)
# Normalize to Linux paths.
p = m.group(1).replace(os.path.sep, '/')
hits.add(p)
return hits
ProTip! Use n and p to navigate between commits in a pull request.