Detect naming convention from file content.
(cls, content: str)
| 144 | |
| 145 | @classmethod |
| 146 | def detect_naming_convention(cls, content: str) -> Optional[str]: |
| 147 | """Detect naming convention from file content.""" |
| 148 | matches = {} |
| 149 | for convention, pattern in cls.NAMING_PATTERNS.items(): |
| 150 | count = len(re.findall(pattern, content)) |
| 151 | if count > 0: |
| 152 | matches[convention] = count |
| 153 | return max(matches, key=matches.get) if matches else None |
| 154 | |
| 155 | @classmethod |
| 156 | def detect_import_style(cls, content: str) -> Optional[str]: |
no outgoing calls