|
31 | 31 | ".md", ".mmd", ".ps1", ".py", ".sh", ".svg", ".toml", ".txt", ".yaml", ".yml", |
32 | 32 | } |
33 | 33 | SPECIAL_TEXT_FILES = {"LICENSE", "README", "SKILL.md", "QUALITY.md", "CLAW_HUB_PUBLISHING.md", ".clawhubignore"} |
| 34 | +DEFAULT_CLAWHUBIGNORE_PATTERNS = [ |
| 35 | + "*.png", "*.jpg", "*.jpeg", "*.gif", "*.ico", "*.pdf", "*.docx", "*.ipynb", "*.ttf", "*.otf", "*.woff", "*.woff2", |
| 36 | + "preview/", "output/", "__pycache__/", "*.py[cod]", "*$py.class", ".mypy_cache/", ".pytest_cache/", ".ruff_cache/", |
| 37 | + ".venv/", "venv/", "env/", "ENV/", ".env", ".env.*", "secrets.json", "*_secret.ini", "*_local.ini", "*.tmp", |
| 38 | + ".DS_Store", "Thumbs.db", "desktop.ini", |
| 39 | +] |
34 | 40 |
|
35 | 41 |
|
36 | 42 | def iter_files(*suffixes: str) -> list[Path]: |
@@ -175,7 +181,10 @@ def frontmatter() -> dict[str, Any]: |
175 | 181 | def ignore_patterns() -> list[str]: |
176 | 182 | ignore_file = ROOT / ".clawhubignore" |
177 | 183 | if not ignore_file.exists(): |
178 | | - raise RuntimeError(".clawhubignore is required for ClawHub publishing") |
| 184 | + if (ROOT / ".git").exists(): |
| 185 | + raise RuntimeError(".clawhubignore is required for ClawHub publishing") |
| 186 | + print("clawhub ignore defaults used: .clawhubignore is not present in this installed package") |
| 187 | + return DEFAULT_CLAWHUBIGNORE_PATTERNS.copy() |
179 | 188 | patterns = [] |
180 | 189 | for raw in ignore_file.read_text(encoding="utf-8").splitlines(): |
181 | 190 | line = raw.strip() |
|
0 commit comments