-
Notifications
You must be signed in to change notification settings - Fork 0
Clone dev 11171 #11
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
base: master
Are you sure you want to change the base?
Clone dev 11171 #11
Conversation
- Modified `split_and_match_files_list` to handle trailing commas correctly. - Ensured empty string entries result in an error to match CLI behavior. - Updated unit tests to cover various edge cases. - Improved test coverage for config parsing with different file list formats.
for more information, see https://pre-commit.ci
Your organization has reached the review limit (30/30 reviews used). To continue using Refacto code reviews, please upgrade your subscription. |
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @visz11, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances Mypy's configuration parsing capabilities by introducing dedicated logic for the 'files' option within the '[mypy]' section of the config file. It ensures that file paths specified in the configuration are correctly interpreted, accommodating various formatting styles like extra spaces and newlines, while also implementing validation to prevent the use of invalid empty filenames. This change improves the reliability and user-friendliness of Mypy's configuration. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces parsing for the files
option from the mypy configuration file and adds corresponding tests. It also adds a check for empty paths during file list expansion. My review identifies a few issues. The logic for handling whitespace-only paths in split_and_match_files_list
is flawed. More critically, the new parsing logic for the files
option in parse_config_file
is immediately overwritten by a subsequent function call, rendering the new validation ineffective for valid configurations. I've also found a minor issue in one of the new tests where it doesn't test what its name implies. I've provided suggestions to fix these issues.
if not path: | ||
continue | ||
|
||
path = expand_path(path.strip()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check for an empty path is good, but it doesn't account for paths that consist only of whitespace. A path like ' '
will pass the if not path:
check, but path.strip()
on the next line will turn it into an empty string, which will then be processed and likely added to expanded_paths
.
To handle this correctly, you should strip the path before checking if it's empty.
if not path: | |
continue | |
path = expand_path(path.strip()) | |
path = path.strip() | |
if not path: | |
continue | |
path = expand_path(path) |
f.write( | ||
""" | ||
[mypy] | ||
files = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
mypy/config_parser.py
(2 hunks)mypy/test/testconfigparser.py
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
mypy/test/testconfigparser.py (1)
mypy/config_parser.py (1)
parse_config_file
(291-390)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
- GitHub Check: Type check our own code (py39-windows-64)
- GitHub Check: Test suite with py311-ubuntu, mypyc-compiled
- GitHub Check: Formatting and code style with Black + ruff
- GitHub Check: Test suite with py313-ubuntu, mypyc-compiled
- GitHub Check: Type check our own code (py39-ubuntu)
- GitHub Check: Test suite with py310-ubuntu
- GitHub Check: Test suite with py312-ubuntu, mypyc-compiled
- GitHub Check: mypyc runtime tests with py39-macos
- GitHub Check: Test suite with py39-windows-64
- GitHub Check: Test suite with py39-ubuntu, mypyc-compiled
- GitHub Check: Test mypyc suite with 32-bit Python
- GitHub Check: Run mypy_primer (2)
- GitHub Check: Run mypy_primer (4)
- GitHub Check: Run mypy_primer (0)
- GitHub Check: Run mypy_primer (1)
- GitHub Check: Run mypy_primer (3)
🔇 Additional comments (1)
mypy/config_parser.py (1)
112-113
: LGTM! Guard prevents processing empty paths.The guard correctly skips empty paths before processing, preventing potential issues with
expand_path
andfileglob.glob
operations.
|
||
if "files" in section: | ||
raw_files = section["files"].strip() | ||
files_split = [file.strip() for file in raw_files.split(",")] | ||
|
||
# Remove trailing empty entry if present | ||
if files_split and files_split[-1] == "": | ||
files_split.pop() | ||
|
||
# Raise an error if there are any remaining empty strings | ||
if "" in files_split: | ||
raise ValueError( | ||
"Invalid config: Empty filenames are not allowed except for trailing commas." | ||
) | ||
|
||
options.files = files_split |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Bypasses existing file processing logic.
This custom parsing bypasses the registered ini_config_types["files"]
handler at line 177, which invokes split_and_match_files
. That function performs essential operations:
- Path expansion (
expand_path
handles~
and environment variables) - Glob pattern matching (supports
*.py
,**/*.py
, etc.) - Recursive directory traversal
Without these, users cannot use globs or environment variables in INI files, creating an inconsistency with TOML (line 207 uses split_and_match_files_list
).
Remove this custom parsing and let parse_section
(line 342) apply the registered handler:
- if "files" in section:
- raw_files = section["files"].strip()
- files_split = [file.strip() for file in raw_files.split(",")]
-
- # Remove trailing empty entry if present
- if files_split and files_split[-1] == "":
- files_split.pop()
-
- # Raise an error if there are any remaining empty strings
- if "" in files_split:
- raise ValueError(
- "Invalid config: Empty filenames are not allowed except for trailing commas."
- )
-
- options.files = files_split
-
prefix = f"{file_read}: [mypy]: "
If empty-string validation is needed, add it to split_and_match_files
(line 125) or split_and_match_files_list
(line 102) where the guard at lines 112-113 already skips empty paths.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if "files" in section: | |
raw_files = section["files"].strip() | |
files_split = [file.strip() for file in raw_files.split(",")] | |
# Remove trailing empty entry if present | |
if files_split and files_split[-1] == "": | |
files_split.pop() | |
# Raise an error if there are any remaining empty strings | |
if "" in files_split: | |
raise ValueError( | |
"Invalid config: Empty filenames are not allowed except for trailing commas." | |
) | |
options.files = files_split | |
prefix = f"{file_read}: [mypy]: " |
🤖 Prompt for AI Agents
In mypy/config_parser.py around lines 324 to 339, the current custom parsing of
the "files" option bypasses the registered ini_config_types["files"] handler
(defined near line 177) and its split_and_match_files logic (around line 125),
which provides path expansion, glob matching, and recursion; remove this custom
parsing block so parse_section (around line 342) will invoke the registered
handler instead, and if you still require empty-string validation move that
guard into split_and_match_files or split_and_match_files_list (around lines
102–125) where empty paths are already handled.
class TestConfigParser(TestCase): | ||
def test_parse_config_file_with_single_file(self) -> None: | ||
"""A single file should be correctly parsed.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = file1.py | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertEqual(options.files, ["file1.py"]) | ||
|
||
def test_parse_config_file_with_no_spaces(self) -> None: | ||
"""Files listed without spaces should be correctly parsed.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files =file1.py,file2.py,file3.py | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertEqual(options.files, ["file1.py", "file2.py", "file3.py"]) | ||
|
||
def test_parse_config_file_with_extra_spaces(self) -> None: | ||
"""Files with extra spaces should be correctly parsed.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = file1.py , file2.py , file3.py | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertEqual(options.files, ["file1.py", "file2.py", "file3.py"]) | ||
|
||
def test_parse_config_file_with_empty_files_key(self) -> None: | ||
"""An empty files key should result in an empty list.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertEqual(options.files, []) | ||
|
||
def test_parse_config_file_with_only_comma(self) -> None: | ||
"""A files key with only a comma should raise an error.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = , | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
with self.assertRaises(ValueError) as cm: | ||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertIn("Invalid config", str(cm.exception)) | ||
|
||
def test_parse_config_file_with_only_whitespace(self) -> None: | ||
"""A files key with only whitespace should result in an empty list.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertEqual(options.files, []) | ||
|
||
def test_parse_config_file_with_mixed_valid_and_invalid_entries(self) -> None: | ||
"""Mix of valid and invalid filenames should raise an error.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = file1.py, , , file2.py | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
with self.assertRaises(ValueError) as cm: | ||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertIn("Invalid config", str(cm.exception)) | ||
|
||
def test_parse_config_file_with_newlines_between_files(self) -> None: | ||
"""Newlines between file entries should be correctly handled.""" | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
config_path = os.path.join(tmpdirname, "test_config.ini") | ||
|
||
with open(config_path, "w") as f: | ||
f.write( | ||
""" | ||
[mypy] | ||
files = file1.py, | ||
file2.py, | ||
file3.py | ||
""" | ||
) | ||
|
||
options = Options() | ||
|
||
parse_config_file(options, lambda: None, config_path, stdout=None, stderr=None) | ||
|
||
self.assertEqual(options.files, ["file1.py", "file2.py", "file3.py"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Test coverage gaps: Missing glob and path expansion validation.
These tests validate the custom parsing at mypy/config_parser.py lines 324-339, but that implementation bypasses the existing split_and_match_files
handler. If the parsing is corrected to use the registered handler (as recommended), add tests for:
- Glob patterns (
*.py
,**/*.py
) - Home directory expansion (
~/myproject/*.py
) - Environment variable expansion (
$HOME/project/*.py
) - Recursive directory matching
Additionally, test_parse_config_file_with_empty_files_key
(lines 67-84) and test_parse_config_file_with_only_whitespace
(lines 106-123) appear to be duplicates—both write files =
and expect []
. Consider removing one.
🤖 Prompt for AI Agents
In mypy/test/testconfigparser.py around lines 9 to 164, the tests only cover
simple comma/space parsing and duplicate the empty-files case (lines ~67-84 and
~106-123); update the parser to use the existing split_and_match_files handler
(the code path around mypy/config_parser.py lines 324-339 should call that
handler rather than doing custom splitting) and remove the duplicate empty-files
test, then add focused unit tests that verify glob expansion (*.py and **/*.py),
home-directory expansion (~/...), environment-variable expansion ($HOME/...),
and recursive directory matching by creating temporary directories/files and
setting os.environ['HOME'] where needed, invoking parse_config_file, and
asserting options.files contains the resolved file paths (and that invalid/mixed
empty entries still raise ValueError).
Diff from mypy_primer, showing the effect of this PR on open source code: spack (https://github.com/spack/spack)
+ Traceback (most recent call last):
+ File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
+ sys.exit(console_entry())
+ ~~~~~~~~~~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+ main()
+ ~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 89, in main
+ sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 1338, in process_options
+ parse_config_file(options, set_strict_flags, config_file, stdout, stderr)
+ ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/config_parser.py", line 326, in parse_config_file
+ raw_files = section["files"].strip()
+ ^^^^^^^^^^^^^^^^^^^^^^
+ AttributeError: 'list' object has no attribute 'strip'
- lib/spack/spack/util/elf.py:220: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:225: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:226: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:228: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:229: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:230: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:233: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:234: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:235: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/llnl/util/lang.py:441: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/llnl/util/lang.py:777: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/llnl/util/lang.py:993: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/llnl/util/filesystem.py:3000: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/operating_systems/windows_os.py:52: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/url.py:91: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/url.py:92: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/url.py:95: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/url.py:96: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/config.py:462: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/config.py:485: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/fetch_strategy.py:392: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/fetch_strategy.py:520: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/fetch_strategy.py:832: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/fetch_strategy.py:833: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/fetch_strategy.py:834: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/version/git_ref_lookup.py:46: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/spec.py:1549: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/spec.py:3554: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/environment/list.py:182: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/database.py:1061: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/database.py:1762: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/database.py:1762: error: All overload variants of "sort" of "list" require at least one argument [call-overload]
- lib/spack/spack/database.py:1762: note: Error code "call-overload" not covered by "type: ignore" comment
- lib/spack/spack/database.py:1762: note: Possible overload variant:
- lib/spack/spack/database.py:1762: note: def sort(self, *, key: Callable[[Spec], SupportsDunderLT[Any] | SupportsDunderGT[Any]], reverse: bool = ...) -> None
- lib/spack/spack/patch.py:185: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/install_test.py:259: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/install_test.py:407: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/install_test.py:517: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/install_test.py:519: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/install_test.py:530: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/install_test.py:846: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/build_environment.py:398: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/build_environment.py:561: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/binary_distribution.py:2185: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/installer.py:222: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/installer.py:2377: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/installer.py:2613: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/solver/asp.py:1398: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/solver/asp.py:3083: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/solver/asp.py:3083: error: All overload variants of "sort" of "list" require at least one argument [call-overload]
- lib/spack/spack/solver/asp.py:3083: note: Error code "call-overload" not covered by "type: ignore" comment
- lib/spack/spack/solver/asp.py:3083: note: Possible overload variant:
- lib/spack/spack/solver/asp.py:3083: note: def sort(self, *, key: Callable[[Spec], SupportsDunderLT[Any] | SupportsDunderGT[Any]], reverse: bool = ...) -> None
- lib/spack/spack/solver/asp.py:3615: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/solver/asp.py:3618: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/solver/asp.py:3621: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/test/versions.py:672: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/test/spec_semantics.py:1980: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/test/sbang.py:58: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/entry_points.py:105: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/graph.py:445: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/graph.py:446: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/graph.py:506: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/unit_test.py:17: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/cmd/python.py:92: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/cmd/create.py:754: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/buildcache_prune.py:169: error: Redundant cast to "URLBuildcacheEntry" [redundant-cast]
- lib/spack/spack/test/cmd/versions.py:39: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
- lib/spack/spack/test/cmd/edit.py:56: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:34: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:35: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:52: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:53: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:57: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:58: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:59: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:70: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:71: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:75: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:76: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:77: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:382: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:459: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:460: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/binary_distribution.py:560: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/binary_distribution.py:1245: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/repo.py:120: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
- lib/spack/spack/test/repo.py:218: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
- lib/spack/spack/test/repo.py:221: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
- lib/spack/spack/ci/common.py:221: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/ci/common.py:239: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/cmd/repo.py:256: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/repo.py:425: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/repo.py:438: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/external.py:144: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/config.py:459: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/checksum.py:90: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/checksum.py:100: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/checksum.py:113: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/buildcache.py:429: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/buildcache.py:850: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/buildcache.py:851: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/env.py:373: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/ci.py:842: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
- lib/spack/spack/cmd/ci.py:843: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
pytest (https://github.com/pytest-dev/pytest)
+ Traceback (most recent call last):
+ File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
+ sys.exit(console_entry())
+ ~~~~~~~~~~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+ main()
+ ~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 89, in main
+ sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 1338, in process_options
+ parse_config_file(options, set_strict_flags, config_file, stdout, stderr)
+ ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/config_parser.py", line 326, in parse_config_file
+ raw_files = section["files"].strip()
+ ^^^^^^^^^^^^^^^^^^^^^^
+ AttributeError: 'list' object has no attribute 'strip'
- src/_pytest/_code/code.py:659: error: Returning Any from function declared to return "BaseException | None" [no-any-return]
- src/_pytest/raises.py:468: error: Unused "type: ignore" comment [unused-ignore]
- src/_pytest/raises.py:470: error: Unused "type: ignore" comment [unused-ignore]
- src/_pytest/raises.py:1216: error: Unused "type: ignore" comment [unused-ignore]
- testing/typing_raises_group.py:109: error: Unused "type: ignore" comment [unused-ignore]
- testing/typing_raises_group.py:112: error: Unused "type: ignore" comment [unused-ignore]
- testing/typing_raises_group.py:116: error: Unused "type: ignore" comment [unused-ignore]
- testing/typing_raises_group.py:119: error: Unused "type: ignore" comment [unused-ignore]
- testing/typing_raises_group.py:123: error: Unused "type: ignore" comment [unused-ignore]
- testing/typing_raises_group.py:124: error: Unused "type: ignore" comment [unused-ignore]
- testing/test_monkeypatch.py:420: error: Statement is unreachable [unreachable]
- testing/test_collection.py:1618: error: Unused "type: ignore" comment [unused-ignore]
- testing/_py/test_local.py:860: error: Item "None" of "local | None" has no attribute "check" [union-attr]
- testing/_py/test_local.py:863: error: Item "None" of "local | None" has no attribute "dirpath" [union-attr]
- testing/_py/test_local.py:914: error: Item "None" of "local | None" has no attribute "check" [union-attr]
- testing/_py/test_local.py:916: error: Item "None" of "local | None" has no attribute "check" [union-attr]
- testing/_py/test_local.py:925: error: Item "None" of "local | None" has no attribute "basename" [union-attr]
- testing/_py/test_local.py:926: error: Item "None" of "local | None" has no attribute "dirpath" [union-attr]
- testing/_py/test_local.py:927: error: Argument "checker" to "sysfind" of "local" has incompatible type "Callable[[local], None]"; expected "Callable[[local], bool] | None" [arg-type]
- testing/_py/test_local.py:927: error: Incompatible return value type (got "None", expected "bool") [return-value]
- testing/_py/test_local.py:931: error: Item "None" of "local | None" has no attribute "sysexec" [union-attr]
- testing/_py/test_local.py:939: error: Cannot assign to a type [misc]
- testing/_py/test_local.py:939: error: Incompatible types in assignment (expression has type "type[RuntimeError]", variable has type "type[ExecutionFailed]") [assignment]
- testing/_py/test_local.py:942: error: Item "None" of "local | None" has no attribute "sysexec" [union-attr]
- testing/_py/test_local.py:1178: error: Module "py.path" has no attribute "isimportable" [attr-defined]
- testing/_py/test_local.py:1195: error: "type[local]" has no attribute "_gethomedir" [attr-defined]
- testing/_py/test_local.py:1201: error: "type[local]" has no attribute "_gethomedir" [attr-defined]
- testing/_py/test_local.py:1283: error: Item "None" of "local | None" has no attribute "new" [union-attr]
- testing/_py/test_local.py:1285: error: Item "None" of "local | None" has no attribute "relto" [union-attr]
- testing/_py/test_local.py:1286: error: Item "None" of "local | None" has no attribute "check" [union-attr]
trio (https://github.com/python-trio/trio)
- src/trio/_tools/sync_requirements.py:12: error: Library stubs not installed for "yaml" [import-untyped]
- src/trio/_tools/sync_requirements.py:19: error: Type of variable becomes "type[Any] | type[Any]" due to an unfollowed import [no-any-unimported]
- src/trio/_tools/sync_requirements.py:22: error: Name "Loader" already defined on line 19 [no-redef]
- src/trio/_tools/sync_requirements.py:24: error: Name "Loader" already defined on line 19 [no-redef]
- src/trio/_socket.py:243: error: Argument 1 to "getaddrinfo" of "HostnameResolver" has incompatible type "bytes | str | None"; expected "bytes | None" [arg-type]
- src/trio/_repl.py:45: error: Argument 2 to "FunctionType" has incompatible type "Mapping[str, Any]"; expected "dict[str, Any]" [arg-type]
- src/trio/_tests/tools/test_sync_requirements.py:10: error: Library stubs not installed for "yaml" [import-untyped]
- src/trio/_tests/tools/test_sync_requirements.py:10: note: Hint: "python3 -m pip install types-PyYAML"
- src/trio/_tests/tools/test_sync_requirements.py:10: note: (or run "mypy --install-types" to install all missing stub packages)
- src/trio/_tests/tools/test_sync_requirements.py:10: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- src/trio/_tests/test_exports.py:163: error: Unused "type: ignore" comment [unused-ignore]
+ Traceback (most recent call last):
+ File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
+ sys.exit(console_entry())
+ ~~~~~~~~~~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+ main()
+ ~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 89, in main
+ sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 1338, in process_options
+ parse_config_file(options, set_strict_flags, config_file, stdout, stderr)
+ ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/config_parser.py", line 326, in parse_config_file
+ raw_files = section["files"].strip()
+ ^^^^^^^^^^^^^^^^^^^^^^
+ AttributeError: 'list' object has no attribute 'strip'
antidote (https://github.com/Finistere/antidote)
+ Traceback (most recent call last):
+ File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
+ sys.exit(console_entry())
+ ~~~~~~~~~~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+ main()
+ ~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 89, in main
+ sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 1338, in process_options
+ parse_config_file(options, set_strict_flags, config_file, stdout, stderr)
+ ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/config_parser.py", line 326, in parse_config_file
+ raw_files = section["files"].strip()
+ ^^^^^^^^^^^^^^^^^^^^^^
+ AttributeError: 'list' object has no attribute 'strip'
- pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
- setup.py:4: error: Library stubs not installed for "setuptools" [import-untyped]
- setup.py:4: note: Hint: "python3 -m pip install types-setuptools"
- setup.py:4: note: (or run "mypy --install-types" to install all missing stub packages)
- src/antidote/core/_wiring.py:15: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/_wiring.py:15: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/_wiring.py:15: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/_wiring.py:15: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/_injection.py:278: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/_injection.py:278: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/_injection.py:278: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/_injection.py:278: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/_inject.py:43: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:43: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/_inject.py:43: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:43: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/_inject.py:93: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:93: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/_inject.py:93: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:93: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/_inject.py:132: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:132: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/_inject.py:141: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:141: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/_inject.py:147: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:147: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/_inject.py:156: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/_inject.py:156: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/__init__.py:192: error: Overloaded function signatures 1 and 3 overlap with incompatible return types [overload-overlap]
- src/antidote/core/__init__.py:197: error: Overloaded function signatures 2 and 3 overlap with incompatible return types [overload-overlap]
- src/antidote/core/__init__.py:197: note: Flipping the order of overloads will fix this error
- src/antidote/core/__init__.py:398: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
- src/antidote/core/__init__.py:398: note: Flipping the order of overloads will fix this error
- src/antidote/core/__init__.py:985: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/__init__.py:985: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/__init__.py:985: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/__init__.py:985: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/__init__.py:1033: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/__init__.py:1033: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/__init__.py:1042: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/core/__init__.py:1042: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/core/__init__.py:1048: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/__init__.py:1048: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/core/__init__.py:1057: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/core/__init__.py:1057: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/lib/lazy_ext/_lazy.py:104: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/_lazy.py:104: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/lazy_ext/_lazy.py:110: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/_lazy.py:110: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:210: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:210: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:216: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:216: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:499: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:499: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:505: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:505: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:635: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/lazy_ext/__init__.py:635: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/_function.py:76: error: Unused "type: ignore" comment [unused-ignore]
- src/antidote/lib/interface_ext/_interface.py:78: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/_interface.py:78: note: Flipping the order of overloads will fix this error
- src/antidote/lib/interface_ext/_interface.py:118: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/_interface.py:118: note: Flipping the order of overloads will fix this error
- src/antidote/lib/interface_ext/_interface.py:257: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/_interface.py:257: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:357: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/__init__.py:357: note: Flipping the order of overloads will fix this error
- src/antidote/lib/interface_ext/__init__.py:396: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/__init__.py:396: note: Flipping the order of overloads will fix this error
- src/antidote/lib/interface_ext/__init__.py:576: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:576: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1014: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1017: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1026: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1029: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1035: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1068: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1207: error: Overloaded function signatures 1 and 2 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/__init__.py:1207: note: Flipping the order of overloads will fix this error
- src/antidote/lib/interface_ext/__init__.py:1237: error: "classmethod" expects 3 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1237: error: Missing type parameters for generic type "classmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1241: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1241: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1263: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1263: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1266: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1266: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1278: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1278: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1281: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1281: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1289: error: Overloaded function signatures 1 and 5 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/__init__.py:1298: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1298: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1299: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1299: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1303: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader [overload-cannot-match]
- src/antidote/lib/interface_ext/__init__.py:1303: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1303: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1321: error: Overloaded function signatures 1 and 5 overlap with incompatible return types [overload-overlap]
- src/antidote/lib/interface_ext/__init__.py:1330: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1330: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1331: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1331: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1335: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader [overload-cannot-match]
- src/antidote/lib/interface_ext/__init__.py:1335: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1335: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1359: error: "staticmethod" expects 2 type arguments, but 1 given [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1359: error: Missing type parameters for generic type "staticmethod" [type-arg]
- src/antidote/lib/interface_ext/__init__.py:1369: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1369: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1372: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1372: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1384: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1384: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/lib/interface_ext/__init__.py:1387: error: Missing return statement [empty-body]
- src/antidote/lib/interface_ext/__init__.py:1387: note: If the method is meant to be abstract, use @abc.abstractmethod
- src/antidote/__init__.py:135: error: Cannot find implementation or library stub for module named "antidote._internal.scm_version" [import-not-found]
- src/antidote/__init__.py:135: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- src/antidote/lib/interface_ext/_provider.py:313: error: Generator has incompatible item type "NewWeight"; expected "Weight" [misc]
- src/antidote/lib/interface_ext/_provider.py:314: error: Argument 2 to "sum" has incompatible type "NewWeight"; expected "Weight" [arg-type]
- docs/conf.py:79: error: Function is missing a type annotation [no-untyped-def]
- docs/conf.py:177: error: Need type annotation for "latex_elements" (hint: "latex_elements: dict[<type>, <type>] = ...") [var-annotated]
- docs/conf.py:223: error: Function is missing a type annotation [no-untyped-def]
- tests/lib/lazy/test_lazy.py:286: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:293: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:301: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:308: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:316: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:324: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:658: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:662: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:668: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:672: error: Missing return statement [empty-body]
- tests/lib/lazy/test_lazy.py:677: error: Missing return statement [empty-body]
... (truncated 103 lines) ...
typeshed-stats (https://github.com/AlexWaygood/typeshed-stats)
+ Traceback (most recent call last):
+ File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
+ sys.exit(console_entry())
+ ~~~~~~~~~~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+ main()
+ ~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 89, in main
+ sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 1338, in process_options
+ parse_config_file(options, set_strict_flags, config_file, stdout, stderr)
+ ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/config_parser.py", line 326, in parse_config_file
+ raw_files = section["files"].strip()
+ ^^^^^^^^^^^^^^^^^^^^^^
+ AttributeError: 'list' object has no attribute 'strip'
- src/typeshed_stats/__init__.py:14: error: Cannot find implementation or library stub for module named "typeshed_stats._version" [import-not-found]
- src/typeshed_stats/__init__.py:14: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- website_macros.py:17: error: Library stubs not installed for "markdown" [import-untyped]
- tests/test_serialize.py:7: error: Library stubs not installed for "markdown" [import-untyped]
- tests/test_serialize.py:9: error: Library stubs not installed for "bs4" [import-untyped]
- tests/test_serialize.py:9: note: Hint: "python3 -m pip install types-beautifulsoup4"
- tests/test_gather.py:23: error: Cannot find implementation or library stub for module named "pytest_mock" [import-not-found]
- tests/test_gather.py:24: error: Cannot find implementation or library stub for module named "pytest_subtests" [import-not-found]
- src/typeshed_stats/_cli.py:80: error: Cannot find implementation or library stub for module named "rich" [import-not-found]
- src/typeshed_stats/_cli.py:80: error: Name "pprint" already defined on line 78 [no-redef]
- src/typeshed_stats/_cli.py:105: error: Cannot find implementation or library stub for module named "rich_argparse" [import-not-found]
- src/typeshed_stats/_cli.py:107: error: Unused "type: ignore" comment [unused-ignore]
- src/typeshed_stats/_cli.py:115: error: Returning Any from function declared to return "type[HelpFormatter]" [no-any-return]
- tests/test__cli.py:16: error: Library stubs not installed for "markdown" [import-untyped]
- tests/test__cli.py:16: note: Hint: "python3 -m pip install types-Markdown"
- tests/test__cli.py:16: note: (or run "mypy --install-types" to install all missing stub packages)
- tests/test__cli.py:18: error: Cannot find implementation or library stub for module named "pytest_mock" [import-not-found]
- tests/test__cli.py:19: error: Cannot find implementation or library stub for module named "pytest_subtests" [import-not-found]
- tests/test__cli.py:447: error: Returning Any from function declared to return "MagicMock" [no-any-return]
- tests/test__cli.py:531: error: Cannot find implementation or library stub for module named "rich" [import-not-found]
sphinx (https://github.com/sphinx-doc/sphinx)
+ Traceback (most recent call last):
+ File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
+ sys.exit(console_entry())
+ ~~~~~~~~~~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+ main()
+ ~~~~^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 89, in main
+ sources, options = process_options(args, stdout=stdout, stderr=stderr, fscache=fscache)
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 1338, in process_options
+ parse_config_file(options, set_strict_flags, config_file, stdout, stderr)
+ ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/config_parser.py", line 326, in parse_config_file
+ raw_files = section["files"].strip()
+ ^^^^^^^^^^^^^^^^^^^^^^
+ AttributeError: 'list' object has no attribute 'strip'
- Warning: unused section(s) in pyproject.toml: module = ['pyximport', 'tests.test_builders.test_build', 'tests.test_builders.test_build_html', 'tests.test_builders.test_build_html_5_output', 'tests.test_builders.test_build_latex', 'tests.test_builders.test_build_linkcheck', 'tests.test_config.test_config', 'tests.test_directives.test_directive_code', 'tests.test_directives.test_directive_other', 'tests.test_directives.test_directive_patch', 'tests.test_directives.test_directives_no_typesetting', 'tests.test_domains.test_domain_c', 'tests.test_domains.test_domain_cpp', 'tests.test_domains.test_domain_js', 'tests.test_domains.test_domain_py', 'tests.test_domains.test_domain_py_fields', 'tests.test_domains.test_domain_py_pyfunction', 'tests.test_domains.test_domain_py_pyobject', 'tests.test_domains.test_domain_rst', 'tests.test_domains.test_domain_std', 'tests.test_environment.test_environment_toctree', 'tests.test_extensions.test_ext_apidoc', 'tests.test_extensions.test_ext_autodoc', 'tests.test_extensions.test_ext_autodoc_autoclass', 'tests.test_extensions.test_ext_autodoc_events', 'tests.test_extensions.test_ext_autodoc_mock', 'tests.test_extensions.test_ext_autosummary', 'tests.test_extensions.test_ext_autosummary_imports', 'tests.test_extensions.test_ext_doctest', 'tests.test_extensions.test_ext_inheritance_diagram', 'tests.test_extensions.test_ext_intersphinx', 'tests.test_extensions.test_ext_intersphinx_cache', 'tests.test_extensions.test_ext_math', 'tests.test_extensions.test_ext_napoleon', 'tests.test_extensions.test_ext_napoleon_docstring', 'tests.test_intl.test_intl', 'tests.test_markup.test_markup', 'tests.test_search', 'tests.test_theming.test_templating', 'tests.test_theming.test_theming', 'tests.test_transforms.test_transforms_post_transforms', 'tests.test_transforms.test_transforms_post_transforms_images', 'tests.test_util.test_util_i18n', 'tests.test_util.test_util_inspect', 'tests.test_util.test_util_logging', 'tests.test_util.test_util_nodes', 'tests.test_util.test_util_typing', 'tests.test_util.typing_test_data', 'tests.test_versioning', 'tests.test_writers.test_docutilsconf']
- sphinx/pygments_styles.py:5:1: error: Library stubs not installed for "pygments.style" [import-untyped]
- sphinx/pygments_styles.py:6:1: error: Library stubs not installed for "pygments.styles.friendly" [import-untyped]
- sphinx/pygments_styles.py:7:1: error: Library stubs not installed for "pygments.token" [import-untyped]
- sphinx/pygments_styles.py: note: In class "NoneStyle":
- sphinx/pygments_styles.py:20:17: error: Class cannot subclass "Style" (has type "Any") [misc]
- sphinx/pygments_styles.py: note: In class "SphinxStyle":
- sphinx/pygments_styles.py:24:19: error: Class cannot subclass "Style" (has type "Any") [misc]
- sphinx/pygments_styles.py: note: In class "PyramidStyle":
- sphinx/pygments_styles.py:40:20: error: Class cannot subclass "Style" (has type "Any") [misc]
- sphinx/util/images.py:15:1: error: Cannot find implementation or library stub for module named "PIL" [import-not-found]
- sphinx/util/parsing.py: note: In function "_fresh_title_style_context":
- sphinx/util/parsing.py:76:61: error: "Struct" has no attribute "title_styles" [attr-defined]
- sphinx/util/parsing.py:77:38: error: "Struct" has no attribute "section_level" [attr-defined]
- sphinx/util/parsing.py:79:5: error: "Struct" has no attribute "title_styles" [attr-defined]
- sphinx/util/parsing.py:80:5: error: "Struct" has no attribute "section_level" [attr-defined]
- sphinx/util/parsing.py:85:9: error: "Struct" has no attribute "title_styles" [attr-defined]
- sphinx/util/parsing.py:86:9: error: "Struct" has no attribute "section_level" [attr-defined]
- sphinx/_cli/util/errors.py:102:1: error: Library stubs not installed for "pygments" [import-untyped]
- sphinx/_cli/util/errors.py:102:1: note: Hint: "python3 -m pip install types-Pygments"
- sphinx/_cli/util/errors.py:102:1: note: (or run "mypy --install-types" to install all missing stub packages)
- sphinx/_cli/util/errors.py:102:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- sphinx/search/__init__.py: note: In function "_is_meta_keywords":
- sphinx/search/__init__.py:193:11: error: Name "nodes.meta" is not defined [name-defined]
- sphinx/search/__init__.py: note: At top level:
- sphinx/search/__init__.py:257: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/search/__init__.py: note: In function "_feed_visit_nodes":
- sphinx/search/__init__.py:627:27: error: Module has no attribute "meta" [attr-defined]
- sphinx/search/__init__.py:638:18: error: "Node" has no attribute "children" [attr-defined]
- sphinx/util/nodes.py: note: In member "findall" of class "NodeMatcher":
- sphinx/util/nodes.py:98:9: error: Need type annotation for "found" [var-annotated]
- sphinx/util/nodes.py: note: At top level:
- sphinx/util/nodes.py:144: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/util/nodes.py: note: In function "is_translatable":
- sphinx/util/nodes.py:279:29: error: Module has no attribute "meta" [attr-defined]
- sphinx/util/nodes.py: note: In function "extract_messages":
- sphinx/util/nodes.py:324:5: error: Need type annotation for "node" [var-annotated]
- sphinx/util/nodes.py:341:31: error: Module has no attribute "meta" [attr-defined]
- sphinx/util/nodes.py: note: At top level:
- sphinx/util/nodes.py:344: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/util/nodes.py:349: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/util/nodes.py: note: In function "nested_parse_with_titles":
- sphinx/util/nodes.py:410:12: error: Incompatible return value type (got "int", expected "str") [return-value]
- sphinx/util/docfields.py:96: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/util/docfields.py:114: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/util/docfields.py: note: In function "make_field":
- sphinx/util/docfields.py:327:31: error: Call to untyped function "astext" in typed context [no-untyped-call]
- sphinx/transforms/__init__.py:95: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/transforms/__init__.py: note: In member "apply" of class "ApplySourceWorkaround":
- sphinx/transforms/__init__.py:243:9: error: Need type annotation for "node" [var-annotated]
- sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:283:9: error: Need type annotation for "node" [var-annotated]
- sphinx/transforms/__init__.py: note: In member "get_tokens" of class "SphinxSmartQuotes":
- sphinx/transforms/__init__.py:398:5: error: Return type "Iterator[tuple[str, str]]" of "get_tokens" incompatible with return type "Generator[tuple[str, str], None, None]" in supertype "SmartQuotes" [override]
- sphinx/transforms/__init__.py: note: In member "apply" of class "GlossarySorter":
- sphinx/transforms/__init__.py:434:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
- sphinx/transforms/__init__.py: note: In function "apply":
- sphinx/transforms/__init__.py:434:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
- sphinx/transforms/__init__.py: note: In member "apply" of class "GlossarySorter":
- sphinx/transforms/__init__.py:434:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
- sphinx/transforms/__init__.py: note: In function "apply":
- sphinx/transforms/__init__.py:434:32: error: Call to untyped function "astext" in typed context [no-untyped-call]
... (truncated 827 lines) ...``` |
/refacto-visz |
Refacto is reviewing this PR. Please wait for the review comments to be posted. |
Code Review: Config Parsing👍 Well Done
📁 Selected files for review (2)
🎯 Custom Instructions
📝 Additional Comments
|
if "files" in section: | ||
raw_files = section["files"].strip() | ||
files_split = [file.strip() for file in raw_files.split(",")] | ||
|
||
# Remove trailing empty entry if present | ||
if files_split and files_split[-1] == "": | ||
files_split.pop() | ||
|
||
# Raise an error if there are any remaining empty strings | ||
if "" in files_split: | ||
raise ValueError( | ||
"Invalid config: Empty filenames are not allowed except for trailing commas." | ||
) | ||
|
||
options.files = files_split |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent Validation Pattern
The code performs partial cleanup before validation by removing trailing empty entries, then validates the remaining input. This violates the repository guideline to validate complete input consistently rather than special-casing positions like trailing elements.
Standards
- Repo-Guideline-Avoid partial cleanup before validation; validate complete input consistently rather than special-casing positions like trailing elements.
if "" in files_split: | ||
raise ValueError( | ||
"Invalid config: Empty filenames are not allowed except for trailing commas." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uninformative Error Message
The error message doesn't provide specific information about which entries are empty or their positions in the input. This violates the repository guideline that error messages should be more informative to help users debug configuration issues.
Standards
- Repo-Guideline-The error message could be more informative
(Explain how this PR changes mypy.)
Summary by CodeRabbit