github / github/codeql

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

Abierto
#3,970 2 comentarios 0 reacciones 0 asignados Ver en GitHub
false-positive Python
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.