MCPcopy Create free account
hub / github.com/FastLED/FastLED / check_forbidden_pattern

Function check_forbidden_pattern

ci/hooks/check_forbidden_commands.py:133–142  ·  view source on GitHub ↗

Check if command matches any forbidden pattern. Returns (True, error_message) if forbidden pattern found, None otherwise.

(command: str)

Source from the content-addressed store, hash-verified

131
132
133def check_forbidden_pattern(command: str) -> tuple[bool, str] | None:
134 """
135 Check if command matches any forbidden pattern.
136
137 Returns (True, error_message) if forbidden pattern found, None otherwise.
138 """
139 for pattern, error_msg in FORBIDDEN_PATTERNS:
140 if re.search(pattern, command):
141 return (True, error_msg)
142 return None
143
144
145def check_forbidden_env_vars(command: str) -> tuple[bool, str, str] | None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected