|
38 | 38 | def generate_expected_manifest(cookiecutter_context: dict) -> list[tuple[str, str]]:
|
39 | 39 | """Generate expected file manifest based on cookiecutter context."""
|
40 | 40 | manifest = []
|
41 |
| - |
| 41 | + |
42 | 42 | # Files created by hooks
|
43 | 43 | hook_files = {".git", ".venv", "uv.lock"}
|
44 |
| - |
| 44 | + |
45 | 45 | # Add base files that don't depend on hooks
|
46 | 46 | for test_type, path in BASE_MANIFEST:
|
47 | 47 | if path not in hook_files:
|
48 | 48 | manifest.append((test_type, path))
|
49 |
| - |
50 |
| - # LICENSE file is always included (even for no-license, it's an Unlicense) |
51 |
| - manifest.append(("is_file", "LICENSE")) |
52 |
| - |
| 49 | + |
| 50 | + if cookiecutter_context.get("license", "no-license") != "no-license": |
| 51 | + manifest.append(("is_file", "LICENSE")) |
| 52 | + |
53 | 53 | # Add files created by hooks if we expect them to have run
|
54 | 54 | if cookiecutter_context.get("_hooks_ran", True):
|
55 |
| - manifest.extend([ |
56 |
| - ("is_dir", ".git"), |
57 |
| - ("is_dir", ".venv"), |
58 |
| - ("is_file", "uv.lock"), |
59 |
| - ]) |
60 |
| - |
| 55 | + manifest.extend( |
| 56 | + [ |
| 57 | + ("is_dir", ".git"), |
| 58 | + ("is_dir", ".venv"), |
| 59 | + ("is_file", "uv.lock"), |
| 60 | + ] |
| 61 | + ) |
| 62 | + |
61 | 63 | return manifest
|
62 | 64 |
|
63 | 65 |
|
64 | 66 | def generate_expected_src_files(cookiecutter_context: dict) -> list[str]:
|
65 | 67 | """Generate expected source files based on cookiecutter context."""
|
66 | 68 | src_files = BASE_SRC.copy()
|
67 |
| - |
| 69 | + |
68 | 70 | # Add settings.py if pydantic-settings is enabled
|
69 | 71 | if cookiecutter_context.get("use_pydantic_settings", True):
|
70 | 72 | src_files.append("settings.py")
|
71 |
| - |
| 73 | + |
72 | 74 | return src_files
|
73 | 75 |
|
74 | 76 |
|
|
0 commit comments