Detect whether async/await patterns are used.
(cls, content: str)
| 177 | |
| 178 | @classmethod |
| 179 | def detect_async_style(cls, content: str) -> Optional[str]: |
| 180 | """Detect whether async/await patterns are used.""" |
| 181 | score = sum( |
| 182 | 1 for p in cls.ASYNC_PATTERNS["async"] |
| 183 | if re.search(p, content, re.MULTILINE) |
| 184 | ) |
| 185 | return "async" if score >= 2 else None |
| 186 | |
| 187 | @classmethod |
| 188 | def detect_preferred_library(cls, content: str, lib_map: Dict, category: str) -> Optional[str]: |
no test coverage detected