diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 29b74a833..1db117199 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -12,5 +12,3 @@ jobs: patch-typing-check: name: Run Patch Type Check uses: codecov/gha-workflows/.github/workflows/mypy.yml@00043f8fbe820934312f7fade4ea72ea92231b5e - with: - extra_config: "--explicit-package-bases" diff --git a/helpers/tests/pathmap/test_pathmap.py b/helpers/tests/pathmap/test_pathmap.py index 9fa1b76b3..6e8625d06 100644 --- a/helpers/tests/pathmap/test_pathmap.py +++ b/helpers/tests/pathmap/test_pathmap.py @@ -6,7 +6,7 @@ def test_clean_path(): assert _clean_path(path) == "some/directory" path = "some/path\r/with/tabs\r" assert _clean_path(path) == "some/path/with/tabs" - path = "some\ very_long/directory\ name" + path = "some\\ very_long/directory\\ name" assert _clean_path(path) == "some very_long/directory name" path = "ms\\style\\directory" assert _clean_path(path) == "ms/style/directory" diff --git a/mypy.ini b/mypy.ini index 4402d0ce5..77f069545 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,8 +1,16 @@ -# Global options: - [mypy] -disallow_untyped_defs = True -ignore_missing_imports = True +explicit_package_bases = True +exclude = /tests/ ; disable type checks in tests (for now) + +; TODO: we eventually want these errors to be enabled: disable_error_code = attr-defined,import-untyped,name-defined -follow_imports = silent -exclude = test_.*\.py$ \ No newline at end of file + +; TODO: and we would also want these additional checks to be enabled +; as they are defined in Sentry as well: +; check_untyped_defs = True +; no_implicit_reexport = True +; warn_unreachable = True +; warn_unused_configs = True +; warn_unused_ignores = True +; warn_redundant_casts = True +; enable_error_code = ignore-without-code,redundant-self diff --git a/services/failure_normalizer.py b/services/failure_normalizer.py index 1dfda4862..fd088067e 100644 --- a/services/failure_normalizer.py +++ b/services/failure_normalizer.py @@ -46,7 +46,7 @@ class FailureNormalizer: Usage: dict_of_regex_strings = [ - "DATE": r"(\d{4}-\d{2}-\d{2})", + "DATE": r"(\\d{4}-\\d{2}-\\d{2})", ] f = FailureNormalizer(dict_of_regex_strings) diff --git a/services/notification/notifiers/tests/unit/test_comment.py b/services/notification/notifiers/tests/unit/test_comment.py index 1d553a304..77c7fe57f 100644 --- a/services/notification/notifiers/tests/unit/test_comment.py +++ b/services/notification/notifiers/tests/unit/test_comment.py @@ -1383,7 +1383,7 @@ async def test_build_message_no_base_report( "", f"| [Files with missing lines](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", "|---|---|---|---|", - f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", + f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", "", "------", "", @@ -1458,7 +1458,7 @@ async def test_build_message_no_base_commit( "", f"| [Files with missing lines](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", "|---|---|---|---|", - f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", + f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", "", "------", "", @@ -4219,7 +4219,7 @@ async def test_build_message_no_base_commit_new_layout( "", f"| [Files with missing lines](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", "|---|---|---|---|", - f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", + f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", "", "", f"[:umbrella: View full report in Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue). ", @@ -4291,7 +4291,7 @@ async def test_build_message_no_base_report_new_layout( "", f"| [Files with missing lines](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", "|---|---|---|---|", - f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", + f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", "", "", "", diff --git a/services/report/languages/tests/unit/test_vb.py b/services/report/languages/tests/unit/test_vb.py index 483a835ab..2fb5a11f5 100644 --- a/services/report/languages/tests/unit/test_vb.py +++ b/services/report/languages/tests/unit/test_vb.py @@ -3,7 +3,7 @@ from services.report.languages import vb from test_utils.base import BaseTestCase -txt = """ +txt = """ @@ -29,9 +29,9 @@ - + - +