Files
Jaganpro 14500403f3 feat: add validation hook test harness and fix 6 validator gaps
Add 104-test pytest harness covering all 16 validation hooks across
7 skills (sf-apex, sf-flow, sf-lwc, sf-soql, sf-metadata,
sf-integration, sf-ai-agentscript). Tests verify dispatcher routing,
individual validator scoring, graceful degradation without external
deps, and edge cases.

Bugs fixed:
- Flow validator timeout: DEFAULT_TIMEOUT (10s) -> HEAVY_TIMEOUT (30s)
- Template validator truncation: critical[:5] -> [:10], warnings[:3] -> [:5]
- AgentScript multi-line variable parsing: adds fallback for YAML-style
  variable declarations so reserved-name checks (ASV-STR-009) fire

Missing routes added:
- LWC CSS files -> sf-lwc SLDS scorer
- .profile-meta.xml -> sf-metadata validator
- .validationRule-meta.xml -> sf-metadata validator

Scoring fix:
- Integration scorer: Named Credential XML files no longer penalized
  for non-applicable Apex categories (was 45/120, now 120/120 max)

Jag Valaiyapathy
2026-03-25 00:29:15 -04:00

83 lines
1.8 KiB
TOML

[project]
name = "sf-skills"
version = "4.0.0"
description = "Salesforce development skills for Claude Code"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [
{ name = "Jag Valaiyapathy" }
]
keywords = ["salesforce", "claude-code", "skills", "hooks"]
dependencies = []
[project.optional-dependencies]
test = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0", # Parallel test execution
]
dev = [
"black>=23.0.0",
"isort>=5.12.0",
"mypy>=1.0.0",
]
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
# This project is a collection of skills (not a Python package)
# We only use pyproject.toml for pytest/tool configuration
py-modules = []
packages = []
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_functions = ["test_*"]
python_classes = ["Test*"]
addopts = [
"-v", # Verbose output
"--tb=short", # Shorter tracebacks
"-ra", # Show summary of all test outcomes
"--strict-markers", # Treat unknown markers as errors
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests requiring external resources",
"hooks: validation hook tests",
"org_required: tests requiring a connected Salesforce org",
]
filterwarnings = [
"ignore::DeprecationWarning",
]
[tool.coverage.run]
source = ["shared/hooks"]
branch = true
omit = [
"tests/*",
"*/__pycache__/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
show_missing = true
fail_under = 70
[tool.black]
line-length = 100
target-version = ["py310"]
[tool.isort]
profile = "black"
line_length = 100