MCPcopy Create free account
hub / github.com/StackStorm/st2 / predicate

Function predicate

pylint_plugins/api_models.py:85–97  ·  view source on GitHub ↗

Astroid (used by pylint) calls this to see if our transform function needs to run.

(cls: nodes.ClassDef)

Source from the content-addressed store, hash-verified

83
84
85def predicate(cls: nodes.ClassDef) -> bool:
86 """
87 Astroid (used by pylint) calls this to see if our transform function needs to run.
88 """
89 if cls.name in CLASS_NAME_SKIPLIST:
90 # class looks like an API model class, but it isn't.
91 return False
92
93 if not cls.name.endswith("API") and "schema" not in cls.locals:
94 # class does not look like an API model class.
95 return False
96
97 return True
98
99
100def transform(cls: nodes.ClassDef):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected