Read .feastignore in the repo root directory (if exists) and return the list of user-defined ignore paths
(repo_root: Path)
| 49 | |
| 50 | |
| 51 | def read_feastignore(repo_root: Path) -> List[str]: |
| 52 | """Read .feastignore in the repo root directory (if exists) and return the list of user-defined ignore paths""" |
| 53 | feast_ignore = repo_root / ".feastignore" |
| 54 | if not feast_ignore.is_file(): |
| 55 | return [] |
| 56 | lines = feast_ignore.read_text().strip().split("\n") |
| 57 | ignore_paths = [] |
| 58 | for line in lines: |
| 59 | # Remove everything after the first occurance of "#" symbol (comments) |
| 60 | if line.find("#") >= 0: |
| 61 | line = line[: line.find("#")] |
| 62 | # Strip leading or ending whitespaces |
| 63 | line = line.strip() |
| 64 | # Add this processed line to ignore_paths if it's not empty |
| 65 | if len(line) > 0: |
| 66 | ignore_paths.append(line) |
| 67 | return ignore_paths |
| 68 | |
| 69 | |
| 70 | def get_ignore_files(repo_root: Path, ignore_paths: List[str]) -> Set[Path]: |