open-vault/tools/semgrep/logger-sprintf.yml
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

33 lines
923 B
YAML

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
rules:
- id: logger-used-with-sprintf
patterns:
- pattern-either:
- pattern: |
logger.Trace(fmt.Sprintf(...))
- pattern: |
logger.Debug(fmt.Sprintf(...))
- pattern: |
logger.Info(fmt.Sprintf(...))
- pattern: |
logger.Warn(fmt.Sprintf(...))
- pattern: |
logger.Error(fmt.Sprintf(...))
- pattern: |
$PARENT.logger.Trace(fmt.Sprintf(...))
- pattern: |
$PARENT.logger.Debug(fmt.Sprintf(...))
- pattern: |
$PARENT.logger.Info(fmt.Sprintf(...))
- pattern: |
$PARENT.logger.Warn(fmt.Sprintf(...))
- pattern: |
$PARENT.logger.Error(fmt.Sprintf(...))
message: "Logger message generated by Sprintf"
languages: [go]
severity: WARNING