Closed leinardi closed 5 years ago
Thanks for reporting!
My first guess is that you use show_column_numbers = True
and mypy still doesn't report column numbers for some errors. Could you please try if you can reproduce the crash with show_column_numbers = False
?
Hey thanks for the quick reply!
Yep, show_column_numbers = False
fixed the crash :+1:
Oh wait, now is crashing again...
This is the output (show_column_numbers
still False
):
gsi/presenter.py:93: error: "init_system_info" of "ViewInterface" does not return a value
gsi/presenter.py:94: error: "__start_refresh" of "Presenter" does not return a value
gsi/presenter.py:111: error: Function is missing a type annotation for one or more arguments
gsi/presenter.py:114: error: Function is missing a type annotation for one or more arguments
gsi/presenter.py:117: error: Function is missing a type annotation for one or more arguments
gsi/presenter.py:120: error: Function is missing a type annotation
gsi/presenter.py:123: error: Function is missing a type annotation
gsi/presenter.py:126: error: Function is missing a type annotation
gsi/presenter.py:129: error: Function is missing a type annotation
gsi/presenter.py:145: error: Function is missing a type annotation for one or more arguments
gsi/interactor.py:32: error: The return type of "__init__" must be None
gsi/interactor.py:32: error: Function is missing a return type annotation
gsi/interactor.py:45: error: The return type of "__init__" must be None
gsi/interactor.py:45: error: Function is missing a return type annotation
gsi/interactor.py:58: error: The return type of "__init__" must be None
gsi/interactor.py:58: error: Function is missing a return type annotation
gsi/interactor.py:73: error: Function is missing a type annotation
gsi/repository.py:43: error: Function is missing a type annotation
gsi/repository.py:72: error: Function is missing a type annotation
gsi/repository.py:87: warning: Returning Any from function declared to return "Optional[CpuDbModel]"
gsi/repository.py:93: error: The return type of "__init__" must be None
gsi/repository.py:93: error: Function is missing a return type annotation
gsi/repository.py:98: error: Function is missing a type annotation for one or more arguments
gsi/repository.py:124: error: Function is missing a return type annotation
gsi/repository.py:139: error: Incompatible types in assignment (expression has type "None", variable has type "Processor")
gsi/repository.py:148: error: Call to untyped function "__parse_data" in typed context
gsi/repository.py:156: error: Argument 1 to "get_cpu_by_name" of "CpuDatabaseRepository" has incompatible type "Optional[str]"; expected "str"
gsi/repository.py:157: error: Argument 2 to "__update_processor_with_cpu" of "ProcCpuinfoRepository" has incompatible type "Optional[CpuDbModel]"; expected "CpuDbModel"
gsi/repository.py:167: error: Function is missing a type annotation
gsi/repository.py:178: error: Call to untyped function "clean_cpu_string" in typed context
gsi/repository.py:183: error: Function is missing a return type annotation
gsi/repository.py:213: error: Function is missing a return type annotation
gsi/repository.py:230: error: Call to untyped function "__read_cache_info" of "SysDevicesCacheRepository" in typed context
gsi/repository.py:233: error: Call to untyped function "__update_cache_count" of "SysDevicesCacheRepository" in typed context
gsi/repository.py:243: error: Function is missing a type annotation
gsi/repository.py:265: error: Function is missing a type annotation
gsi/repository.py:266: error: Incompatible types in assignment (expression has type "None", variable has type "Cache")
gsi/repository.py:267: error: Incompatible types in assignment (expression has type "None", variable has type "Cache")
gsi/repository.py:268: error: Incompatible types in assignment (expression has type "None", variable has type "Cache")
gsi/repository.py:269: error: Incompatible types in assignment (expression has type "None", variable has type "Cache")
gsi/repository.py:275: error: Unsupported operand types for + ("Optional[int]" and "int")
gsi/repository.py:279: error: Unsupported operand types for + ("Optional[int]" and "int")
gsi/repository.py:283: error: Unsupported operand types for + ("Optional[int]" and "int")
gsi/repository.py:287: error: Unsupported operand types for + ("Optional[int]" and "int")
gsi/repository.py:301: error: Function is missing a return type annotation
gsi/util.py:109: warning: Returning Any from function declared to return "Optional[str]"
gsi/util.py:130: error: Incompatible types in string interpolation (expression has type "Optional[int]", placeholder has type "Union[int, float]")
gsi/util.py:132: error: Unsupported left operand type for * (some union)
gsi/util.py:132: error: Unsupported operand types for * (likely involving Union)
gsi/util.py:136: error: Incompatible types in string interpolation (expression has type "Optional[int]", placeholder has type "Union[int, float]")
gsi/util.py:140: error: Incompatible types in string interpolation (expression has type "Optional[int]", placeholder has type "Union[int, float]")
gsi/util.py:144: error: Syntax error in type annotation
gsi/util.py:144: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn)
gsi/view.py:40: error: The return type of "__init__" must be None
gsi/view.py:40: error: Function is missing a return type annotation
gsi/view.py:50: error: Call to untyped function "__init_widgets" in typed context
gsi/view.py:52: error: Function is missing a type annotation
gsi/view.py:65: error: Function is missing a type annotation
gsi/view.py:73: error: Function is missing a type annotation
gsi/view.py:78: error: Function is missing a type annotation
gsi/view.py:82: error: Function is missing a return type annotation
gsi/view.py:85: error: Call to untyped function "init_system_info" in typed context
gsi/view.py:87: error: Function is missing a return type annotation
gsi/view.py:90: error: Call to untyped function "init_system_info" in typed context
gsi/view.py:92: error: Function is missing a type annotation
gsi/view.py:95: error: Function is missing a type annotation
gsi/view.py:98: error: Function is missing a type annotation
gsi/view.py:101: error: Function is missing a type annotation
gsi/view.py:104: error: Function is missing a return type annotation
gsi/view.py:121: error: Incompatible types in string interpolation (expression has type "Optional[float]", placeholder has type "Union[int, float]")
gsi/view.py:123: error: Argument 1 to "format_cache_size" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:124: error: Argument 1 to "format_cache_ways" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:125: error: Argument 1 to "format_cache_sets" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:127: error: Argument 2 to "__set_entries_with_label_text" of "View" has incompatible type "Dict[str, Optional[str]]"; expected "Dict[str, str]"
gsi/view.py:129: error: Argument 1 to "format_cache_size" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:130: error: Argument 1 to "format_cache_ways" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:131: error: Argument 1 to "format_cache_sets" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:133: error: Argument 2 to "__set_entries_with_label_text" of "View" has incompatible type "Dict[str, Optional[str]]"; expected "Dict[str, str]"
gsi/view.py:135: error: Argument 1 to "format_cache_size" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:136: error: Argument 1 to "format_cache_ways" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:137: error: Argument 1 to "format_cache_sets" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:139: error: Argument 2 to "__set_entries_with_label_text" of "View" has incompatible type "Dict[str, Optional[str]]"; expected "Dict[str, str]"
gsi/view.py:141: error: Argument 1 to "format_cache_size" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:142: error: Argument 1 to "format_cache_ways" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:143: error: Argument 1 to "format_cache_sets" has incompatible type "Optional[Cache]"; expected "Cache"
gsi/view.py:145: error: Argument 2 to "__set_entries_with_label_text" of "View" has incompatible type "Dict[str, Optional[str]]"; expected "Dict[str, str]"
gsi/view.py:149: error: Incompatible types in string interpolation (expression has type "Optional[float]", placeholder has type "Union[int, float]")
gsi/view.py:150: error: Argument 1 to "__setup_flags_widgets" of "View" has incompatible type "Optional[List[str]]"; expected "List[str]"
gsi/view.py:151: error: Argument 1 to "__setup_bugs_widgets" of "View" has incompatible type "Optional[List[str]]"; expected "List[str]"
gsi/view.py:170: error: Function is missing a return type annotation
gsi/view.py:182: error: Function is missing a return type annotation
gsi/view.py:194: error: Function is missing a return type annotation
gsi/view.py:205: error: Function is missing a return type annotation
gsi/view.py:209: error: Invalid index type "Optional[int]" for "List[Dict[int, Processor]]"; expected type "int"
gsi/view.py:216: error: Function is missing a return type annotation
gsi/view.py:225: error: Function is missing a return type annotation
gsi/view.py:240: error: Function is missing a return type annotation
gsi/view.py:256: error: Function is missing a return type annotation
java.lang.NullPointerException
at javax.swing.JComponent.scrollRectToVisible(JComponent.java:3109)
at com.dropbox.plugins.mypy_plugin.MypyRunner.runMypyDaemon(MypyRunner.java:86)
at com.dropbox.plugins.mypy_plugin.MypyTerminal$10.run(MypyTerminal.java:344)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Mmm this is weird: if I stop dmypy
, restart PyCharm, it works only the first time (if I press run again it crashes).
I was starting the scan with dmypy run -- ``--config-file=mypy.ini gsi
.
Now I added dmypy start
on front and it seems to work fine! (dmypy start; dmypy run -- ``--config-file=mypy.ini gsi
).
Any idea why?
I actually never tried it with dmypy run
. I typically do dmypy start <options> ; dmypy check <target>
. dmypy run
supposed to be equivalent to the former, but maybe there is a subtle difference, I need to investigate.
I was not able to use the --config-file=mypy.ini
option using the check
parameter.
Off topic question: I am trying to build this plugin myself but, I have imported it on my IntelliJ IDEA and I am able to build using the green hummer icon, but how can I test my build on PyCharm?
Edit:
Never mind, I just had to select Build | Prepare Plugin Module ‘
I think I finally understand why it crashes. On this line if there were no debug output from the daemon (like Daemon started
, or Daemon is already running
, etc.), then max
will be zero, and getCellBounds
returns null
in this case instead of an empty rectangle.
This should be easy to fix, we just need to make this call conditional on max > 0
.
The plugin crashes with a NPE with this mypy output:
Stacktrace:
mypy.ini
PyCharm 2018.2.1 (Community Edition) Build #PC-182.3911.33, built on August 5, 2018 JRE: 1.8.0_152-release-1248-b8 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.15.0-32-generic