Python S930 FP with logging.basicConfig

  • Product: SonarCloud
  • Lang: Python
  • Rule: S930 → “Remove this unexpected named argument ‘force’.”

The library and the force param is documented here: logging — Logging facility for Python — Python 3.11.0 documentation

import logging
FORMAT = "[%(levelname)s] [%(request_id)s] [%(relativepath)s:%(lineno)d] [%(funcName)s] - %(message)s"
logging.basicConfig(format=FORMAT, force=True)  # false-positive

Also a screenshot just in case:

Hello @ric-rc,

Thank you for reporting this false positive! I have created the following ticket to track it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.