UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

33 lines (32 loc) 1.05 kB
rules: - id: identical-is-comparison pattern: $S is $S message: Found identical comparison using is. Ensure this is what you intended. languages: [python] severity: ERROR metadata: category: correctness technology: - python - id: string-is-comparison patterns: - pattern-not: $S is None - pattern-not: type($X) is $T - pattern-not: $S is True - pattern-not: $S is False - pattern-not: $S is "" - pattern-either: - pattern: $S is "..." # quotes needed b/c YAML complains if starting with "..." - pattern: '"..." is $S' message: >- Found string comparison using 'is' operator. The 'is' operator is for reference equality, not value equality, and therefore should not be used to compare strings. For more information, see https://github.com/satwikkansal/wtfpython#-how-not-to-use-is-operator" languages: [python] severity: ERROR metadata: category: correctness technology: - python