Resolve --content and the deprecated --include-text-files into a list of ContentType values.
(content: list[str], include_text_files: bool)
| 84 | |
| 85 | |
| 86 | def _resolve_content(content: list[str], include_text_files: bool) -> list[ContentType]: |
| 87 | """Resolve --content and the deprecated --include-text-files into a list of ContentType values.""" |
| 88 | if include_text_files: |
| 89 | warnings.warn( |
| 90 | "--include-text-files is deprecated and will be removed in a future version. Use --content all instead.", |
| 91 | DeprecationWarning, |
| 92 | stacklevel=2, |
| 93 | ) |
| 94 | if include_text_files or "all" in content: |
| 95 | return [ContentType.CODE, ContentType.DOCS, ContentType.CONFIG] |
| 96 | return [ContentType(c) for c in content] |
| 97 | |
| 98 | |
| 99 | def _load_index(path: str, content: list[ContentType]) -> SembleIndex: |
no test coverage detected