github / github/codeql

LGTM.com - false positive - Python: Wrong number of arguments for format

Đang mở
#3,970 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
false-positive Python
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**Description of the false positive**

In multiple places, constructs such as `var = '[0:%s]' % (cols)` and `print("\n%d files:" % len(filenames))` raise alert of type [Wrong number of arguments for format](https://lgtm.com/rules/2970098/).

I believe this may be caused by an incorrect interpretation of the parens where `(5)` is considered to be a singleton tuple whereas it should be `(5,)` however I am not sure if this is it.

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

https://lgtm.com/projects/g/JetBrains/intellij-community/snapshot/4142f5da479541c769625ab66eeadcbb03e4211b/files/python/helpers/pydev/_pydevd_bundle/pydevd_vars.py?sort=name&dir=ASC&mode=heatmap#xc5d0fd0dff6372d9:1

https://lgtm.com/projects/g/JetBrains/intellij-community/snapshot/4142f5da479541c769625ab66eeadcbb03e4211b/files/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py#xa38757d85e31d8b0:1

https://lgtm.com/projects/g/JetBrains/intellij-community/snapshot/4142f5da479541c769625ab66eeadcbb03e4211b/files/python/helpers/coveragepy/coverage/cmdline.py#xa8bd8b0e65e16629:1

@RasmusSemmle @RasmusWL

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.