2

CodeQL reports some true and some false positive for a specific rule.

Is there a way to mark a Python codeline so that the check is ignored by CodeQL?

Similar, for example to # noqa for Python flake or pep-8 checks.

wovano
  • 4,543
  • 5
  • 22
  • 49
Josef
  • 21,998
  • 3
  • 54
  • 67

1 Answers1

1

Check out one alternative using the open source project advanced-security/dismiss-alerts. It introduces an additional CodeQL query to extract out //codeql[py/line-too-long] or # noqa style comments in your code (see test.py). Those comments are then fed into the SARIF suppression[] object and dismissed in Code Scanning by calling the GitHub alerts api.

felickz
  • 4,292
  • 3
  • 33
  • 37