From 8c6ba06add03487f62ccc0a5bb188c43e6ca5a4f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 14 Nov 2016 10:37:03 -0800 Subject: [PATCH] Silence new flake8 error (E305). --- mypy/checker.py | 1 + mypy/nodes.py | 1 + mypy/report.py | 8 ++++++++ mypy/test/testsemanal.py | 1 + setup.py | 1 + 5 files changed, 12 insertions(+) diff --git a/mypy/checker.py b/mypy/checker.py index 9373c8797e2d..26614523538e 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -2399,6 +2399,7 @@ def push_type_map(self, type_map: Optional[Dict[Expression, Type]]) -> None: # probably be better to have the dict keyed by the nodes' literal_hash # field instead. + TypeMap = Optional[Dict[Expression, Type]] diff --git a/mypy/nodes.py b/mypy/nodes.py index 79bdaf3f8204..013373cf2344 100644 --- a/mypy/nodes.py +++ b/mypy/nodes.py @@ -144,6 +144,7 @@ class Statement(Node): class Expression(Node): """An expression node.""" + # TODO: # Lvalue = Union['NameExpr', 'MemberExpr', 'IndexExpr', 'SuperExpr', 'StarExpr' # 'TupleExpr', 'ListExpr']; see #1783. diff --git a/mypy/report.py b/mypy/report.py index c1c69be17d1f..2bb55aa3f971 100644 --- a/mypy/report.py +++ b/mypy/report.py @@ -131,6 +131,7 @@ def on_finish(self) -> None: f.write('{:7} {:7} {:6} {:6} {}\n'.format( c[0], c[1], c[2], c[3], p)) + register_reporter('linecount', LineCountReporter) @@ -240,6 +241,7 @@ def on_finish(self) -> None: with open(os.path.join(self.output_dir, 'coverage.json'), 'w') as f: json.dump({'lines': self.lines_covered}, f) + register_reporter('linecoverage', LineCoverageReporter) @@ -256,6 +258,7 @@ def on_file(self, tree: MypyFile, type_map: Dict[Expression, Type]) -> None: def on_finish(self) -> None: stats.generate_html_index(self.output_dir) + register_reporter('old-html', OldHtmlReporter) @@ -346,6 +349,7 @@ def on_finish(self) -> None: self.last_xml = doc + register_reporter('memory-xml', MemoryXmlReporter, needs_lxml=True) @@ -466,6 +470,7 @@ def on_finish(self) -> None: self.doc.write(out_path, encoding='utf-8', pretty_print=True) print('Generated Cobertura report:', os.path.abspath(out_path)) + register_reporter('cobertura-xml', CoberturaXmlReporter, needs_lxml=True) @@ -511,6 +516,7 @@ def on_finish(self) -> None: shutil.copyfile(self.memory_xml.css_html_path, out_css) print('Generated XML report:', os.path.abspath(out_path)) + register_reporter('xml', XmlReporter, needs_lxml=True) @@ -550,6 +556,7 @@ def on_finish(self) -> None: shutil.copyfile(self.memory_xml.css_html_path, out_css) print('Generated HTML report (via XSLT):', os.path.abspath(out_path)) + register_reporter('xslt-html', XsltHtmlReporter, needs_lxml=True) @@ -576,6 +583,7 @@ def on_finish(self) -> None: out_file.write(transformed_txt) print('Generated TXT report (via XSLT):', os.path.abspath(out_path)) + register_reporter('xslt-txt', XsltTxtReporter, needs_lxml=True) alias_reporter('xslt-html', 'html') diff --git a/mypy/test/testsemanal.py b/mypy/test/testsemanal.py index 106d52ff3d17..69ae28bb1aa6 100644 --- a/mypy/test/testsemanal.py +++ b/mypy/test/testsemanal.py @@ -93,6 +93,7 @@ def test_semanal(testcase): 'Invalid semantic analyzer output ({}, line {})'.format(testcase.file, testcase.line)) + # Semantic analyzer error test cases # Paths to files containing test case descriptions. diff --git a/setup.py b/setup.py index f9c249fb7b98..4a763625207e 100644 --- a/setup.py +++ b/setup.py @@ -84,6 +84,7 @@ def run(self): 'Topic :: Software Development', ] + package_dir = {'mypy': 'mypy'} if sys.version_info < (3, 5, 0): package_dir[''] = 'lib-typing/3.2'