用途:审计并维护 .gitattributes 的 export-ignore 规则,确保通过 git archive 构建的 WordPress.org 发布压缩包只包含运行时文件,不把开发工具、测试、CI 和仓库元数据发布给用户;同时清理已不存在文件的陈旧规则。
主要能力:用命令列出发布归档根目录条目:git archive --format=tar HEAD | tar -t | awk -F/ '{print $1}' | sort -u;预览未提交修改时加 --worktree-attributes。输出应只含运行时工件,本插件即 LICENSE、readme.txt、activitypub.php、assets、build、includes、integration、patterns、templates,其余即为缺口需补 export-ignore。还可交叉核对跟踪文件与忽略规则,识别失效条目。
使用方式:在打版本前、新增或重命名顶层文件/配置后、引入新开发工具后、linter 配置迁移改名后运行审计。规则写法:用前导 / 锚定根目录,如 /phpcs.xml;目录用尾部 /,如 /tests/。可加 linguist 属性塑造 GitHub 语言统计,但不影响归档。
适用场景:WordPress 插件等需用 git archive 发布的仓库。限制:git archive HEAD 读取提交中的 .gitattributes,未提交改动需用 --worktree-attributes 预览;资料未提供其他平台或自动化集成方式。