MLOps Validation ✅
Automated quality and security checks.
Features
1. Pre-commit Hooks 🔧
Setup automated checks:
CODEBLOCK0
Runs on every commit:
- - Ruff (linting + formatting)
- MyPy (type checking)
- Bandit (security)
2. Test Fixtures 🧪
Shared pytest setup:
CODEBLOCK1
Provides fixtures:
- -
sample_df - Test dataframe - INLINECODE1 - Temporary directory
- INLINECODE2 - Config dict
- INLINECODE3 - Pre-split data
Quick Start
CODEBLOCK2
Commands
CODEBLOCK3
Author
Converted from MLOps Coding Course
Changelog
v1.0.0 (2026-02-18)
- - Initial OpenClaw conversion
- Added pre-commit config
- Added test fixtures
技能名称: mlops-validation-cn
详细描述:
MLOps 验证 ✅
自动化质量与安全检查。
功能特性
1. 预提交钩子 🔧
设置自动化检查:
bash
cp references/pre-commit-config.yaml ../your-project/.pre-commit-config.yaml
cd ../your-project
pre-commit install
每次提交时运行:
- - Ruff(代码检查 + 格式化)
- MyPy(类型检查)
- Bandit(安全扫描)
2. 测试夹具 🧪
共享的 pytest 设置:
bash
cp references/conftest.py ../your-project/tests/
提供以下夹具:
- - sampledf - 测试数据框
- tempdir - 临时目录
- sampleconfig - 配置字典
- traintest_split - 预分割数据
快速开始
bash
复制预提交配置
cp references/pre-commit-config.yaml ./.pre-commit-config.yaml
安装钩子
pre-commit install
手动运行
pre-commit run --all-files
设置测试夹具
cp references/conftest.py tests/
运行测试
pytest tests/ -v --cov=src
命令
bash
类型检查
mypy src/
代码检查
ruff check src/ tests/
格式化
ruff format src/ tests/
测试
pytest tests/ --cov=src
安全扫描
bandit -r src/
作者
源自 MLOps 编码课程
更新日志
v1.0.0 (2026-02-18)
- - 初始 OpenClaw 转换
- 添加预提交配置
- 添加测试夹具