Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/framework/skills/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from __future__ import annotations

import stat
import sys
from dataclasses import dataclass, field
from pathlib import Path

Expand Down Expand Up @@ -134,9 +135,10 @@ def validate_strict(path: Path) -> ValidationResult:
warnings.append("No 'license' field — consider adding a license (e.g. MIT, Apache-2.0).")

# 11. Scripts in scripts/ exist and are executable
# Windows has no POSIX executable bits; skip this check there.
base_dir = path.parent
scripts_dir = base_dir / "scripts"
if scripts_dir.is_dir():
if scripts_dir.is_dir() and sys.platform != "win32":
for script_path in sorted(scripts_dir.iterdir()):
if script_path.is_file():
if not (script_path.stat().st_mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)):
Expand Down
5 changes: 5 additions & 0 deletions core/tests/test_skill_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@

from __future__ import annotations

import sys
from pathlib import Path

import pytest

from framework.skills.validator import validate_strict


Expand Down Expand Up @@ -272,6 +275,7 @@ def test_error_on_empty_body(self, tmp_path):


class TestCheck11Scripts:
@pytest.mark.skipif(sys.platform == "win32", reason="Windows has no POSIX executable bits")
def test_error_on_non_executable_script(self, tmp_path):
path = _write_skill(tmp_path, _VALID_CONTENT)
scripts_dir = path.parent / "scripts"
Expand All @@ -285,6 +289,7 @@ def test_error_on_non_executable_script(self, tmp_path):
assert result.passed is False
assert any("executable" in e.lower() for e in result.errors)

@pytest.mark.skipif(sys.platform == "win32", reason="Windows has no POSIX executable bits")
def test_passes_with_executable_script(self, tmp_path):
path = _write_skill(tmp_path, _VALID_CONTENT)
scripts_dir = path.parent / "scripts"
Expand Down
Loading