Merge 0dbc989b85 into da71eaebd2
This commit is contained in:
commit
5777e73a05
@ -28,4 +28,45 @@ describe("ensureSkillsWatcher", () => {
|
|||||||
expect(ignored.some((re) => re.test("/tmp/workspace/skills/.git/config"))).toBe(true);
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/.git/config"))).toBe(true);
|
||||||
expect(ignored.some((re) => re.test("/tmp/.hidden/skills/index.md"))).toBe(false);
|
expect(ignored.some((re) => re.test("/tmp/.hidden/skills/index.md"))).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("ignores Python virtual environments and cache directories", async () => {
|
||||||
|
const mod = await import("./refresh.js");
|
||||||
|
const ignored = mod.DEFAULT_SKILLS_WATCH_IGNORED;
|
||||||
|
|
||||||
|
// Python virtual environments
|
||||||
|
expect(
|
||||||
|
ignored.some((re) => re.test("/tmp/workspace/skills/.venv/lib/python3.9/site-packages/")),
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
ignored.some((re) => re.test("/tmp/workspace/skills/venv/lib/python3.9/site-packages/")),
|
||||||
|
).toBe(true);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/env/bin/python"))).toBe(true);
|
||||||
|
|
||||||
|
// Python cache directories
|
||||||
|
expect(
|
||||||
|
ignored.some((re) => re.test("/tmp/workspace/skills/__pycache__/module.cpython-39.pyc")),
|
||||||
|
).toBe(true);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/.pytest_cache/"))).toBe(true);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/.tox/py39/lib/"))).toBe(true);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/package.egg-info/PKG-INFO"))).toBe(
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Should not ignore files that just contain these names
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/my_venv_config.json"))).toBe(false);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/pytest.ini"))).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("ignores build artifacts and cache directories", async () => {
|
||||||
|
const mod = await import("./refresh.js");
|
||||||
|
const ignored = mod.DEFAULT_SKILLS_WATCH_IGNORED;
|
||||||
|
|
||||||
|
// Build artifacts
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/build/output.js"))).toBe(true);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/.cache/data.json"))).toBe(true);
|
||||||
|
|
||||||
|
// Should not ignore normal skill files
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/my-skill/build.md"))).toBe(false);
|
||||||
|
expect(ignored.some((re) => re.test("/tmp/workspace/skills/my-skill/SKILL.md"))).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -31,6 +31,19 @@ export const DEFAULT_SKILLS_WATCH_IGNORED: RegExp[] = [
|
|||||||
/(^|[\\/])\.git([\\/]|$)/,
|
/(^|[\\/])\.git([\\/]|$)/,
|
||||||
/(^|[\\/])node_modules([\\/]|$)/,
|
/(^|[\\/])node_modules([\\/]|$)/,
|
||||||
/(^|[\\/])dist([\\/]|$)/,
|
/(^|[\\/])dist([\\/]|$)/,
|
||||||
|
// Python virtual environments
|
||||||
|
/(^|[\\/])\.venv([\\/]|$)/,
|
||||||
|
/(^|[\\/])venv([\\/]|$)/,
|
||||||
|
/(^|[\\/])env([\\/]|$)/,
|
||||||
|
// Python cache directories
|
||||||
|
/(^|[\\/])__pycache__([\\/]|$)/,
|
||||||
|
/(^|[\\/])\.pytest_cache([\\/]|$)/,
|
||||||
|
/(^|[\\/])\.mypy_cache([\\/]|$)/,
|
||||||
|
/(^|[\\/])\.tox([\\/]|$)/,
|
||||||
|
/(^|[\\/])[^/\\]*\.egg-info([\\/]|$)/,
|
||||||
|
// Build artifacts and caches
|
||||||
|
/(^|[\\/])build([\\/]|$)/,
|
||||||
|
/(^|[\\/])\.cache([\\/]|$)/,
|
||||||
];
|
];
|
||||||
|
|
||||||
function bumpVersion(current: number): number {
|
function bumpVersion(current: number): number {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user