Given a list of filepaths, determine the language from the first valid extension :param list[str] individual_files: :rtype: str
(individual_files)
| 266 | |
| 267 | |
| 268 | def determine_language(individual_files): |
| 269 | """ |
| 270 | Given a list of filepaths, determine the language from the first |
| 271 | valid extension |
| 272 | |
| 273 | :param list[str] individual_files: |
| 274 | :rtype: str |
| 275 | """ |
| 276 | for source, _ in individual_files: |
| 277 | suffix = source.rsplit('.', 1)[-1] |
| 278 | if suffix in LANGUAGES: |
| 279 | logging.info("Implicitly detected language as %r.", suffix) |
| 280 | return suffix |
| 281 | raise AssertionError(f"Language could not be detected from input {individual_files}. ", |
| 282 | "Try explicitly passing the language flag.") |
| 283 | |
| 284 | |
| 285 | def get_sources_and_language(raw_source_paths, language): |
no outgoing calls
no test coverage detected