Files matching .graphifyignore patterns are excluded from detect().
(tmp_path)
| 97 | |
| 98 | |
| 99 | def test_graphifyignore_excludes_file(tmp_path): |
| 100 | """Files matching .graphifyignore patterns are excluded from detect().""" |
| 101 | (tmp_path / ".graphifyignore").write_text("vendor/\n*.generated.py\n") |
| 102 | vendor = tmp_path / "vendor" |
| 103 | vendor.mkdir() |
| 104 | (vendor / "lib.py").write_text("x = 1") |
| 105 | (tmp_path / "main.py").write_text("print('hi')") |
| 106 | (tmp_path / "schema.generated.py").write_text("x = 1") |
| 107 | |
| 108 | result = detect(tmp_path) |
| 109 | file_list = result["files"]["code"] |
| 110 | assert any("main.py" in f for f in file_list) |
| 111 | assert not any("vendor" in f for f in file_list) |
| 112 | assert not any("generated" in f for f in file_list) |
| 113 | assert result["graphifyignore_patterns"] == 2 |
| 114 | |
| 115 | |
| 116 | def test_graphifyignore_missing_is_fine(tmp_path): |