Skip to content

Commit

Permalink
allow baseline to work when using different targets
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Dec 16, 2021
1 parent a297037 commit 41706dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .mypy/baseline.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .mypy/proper_plugin.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions mypy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self,
def filter_prefix(error_map: Dict[str, List[ErrorInfo]]) -> Dict[str, List[ErrorInfo]]:
"""Convert absolute paths to relative paths in an error_map"""
result = {
remove_path_prefix(file, os.getcwd()).replace(os.sep, "/"): errors
Path(file).resolve().relative_to(Path.cwd()).as_posix(): errors
for file, errors in error_map.items()
}
for errors in result.values():
Expand Down Expand Up @@ -830,7 +830,7 @@ def filter_baseline(self) -> None:
self.all_errors = self.error_info_map.copy()
for file, errors in self.error_info_map.items():
baseline_errors = self.baseline.get(
remove_path_prefix(file, os.getcwd()).replace(os.sep, "/"))
Path(file).resolve().relative_to(Path.cwd()).as_posix())
if not baseline_errors:
continue
new_errors = []
Expand Down
6 changes: 3 additions & 3 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,15 @@ def add_invertible_flag(flag: str,
help="Suppress toplevel errors caused by missing annotations",
group=strictness_group)

add_invertible_flag('--disallow-redefinition', default=True, dest="allow-redefinition",
add_invertible_flag('--disallow-redefinition', default=True, dest="allow_redefinition",
help="Disallow unconditional variable redefinition with a new type",
group=strictness_group)

add_invertible_flag('--no-implicit-reexport', default=True, dest='implicit_reexport',
help="Treat imports as private unless aliased",
group=strictness_group)

add_invertible_flag('--no-strict-equality', default=True, dest="strict-equality",
add_invertible_flag('--no-strict-equality', default=True, dest="strict_equality",
help="Allow equality, identity, and container checks for"
" non-overlapping types",
group=strictness_group)
Expand All @@ -703,7 +703,7 @@ def add_invertible_flag(flag: str,
add_invertible_flag('--show-column-numbers', default=False,
help="Show column numbers in error messages",
group=error_group)
add_invertible_flag('--no-show-error-codes', default=True, dest="show-error-codes",
add_invertible_flag('--no-show-error-codes', default=True, dest="show_error_codes",
help="Don't show error codes in error messages",
group=error_group)
add_invertible_flag('--pretty', default=False,
Expand Down

0 comments on commit 41706dc

Please sign in to comment.