github / github/codeql

LGTM.com - false positive when using imports with TYPE_CHECKING

オープン
#4,258 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
false-positive Python
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**Description of the false positive**

lgtm complains that a "Module is imported more than once" in my python code, but the first import ist protected by "if TYPE_CHECKING:", which is required for mypy type checking to work properly. I think lgtm should simply ignore imports that are under `TYPE_CHECKING`.

**URL to the alert on the project page on LGTM.com**

Here is the concrete error:
https://lgtm.com/projects/g/zwicker-group/py-pde/snapshot/67363039e04aebcfba93b01fcf65014bec37aebb/files/pde/tools/plotting.py?sort=name&dir=ASC&mode=heatmap#x70f271ca0359e14c:1

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。