MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / detect_naming_convention

Method detect_naming_convention

core/preferences.py:146–153  ·  view source on GitHub ↗

Detect naming convention from file content.

(cls, content: str)

Source from the content-addressed store, hash-verified

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]:

Callers 2

Calls

no outgoing calls

Tested by 1