关于 Ranuk Web Accessibility & AST Security Auditor
ADA-Audits 是面向 Python 项目和笔记本的命令行审计工具,可检查数据无障碍问题、缺失的文档字符串和类型提示,并为开发者及 CI/CD 工作流生成报告。
主要功能
- 01扫描 Python 文件和笔记本
- 02发现无障碍问题
- 03检查文档字符串和类型提示
- 04生成审计报告
- 05集成 CI/CD 流水线
适用场景
- 01审计 Python 源代码目录
- 02检查笔记本中的无障碍问题
- 03生成 Markdown、JSON 或 HTML 报告
- 04在 CI/CD 流水线中运行审计
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
服务地址
https://audit.ranuk.dev/mcp一键复制安装命令
Claude CodeTerminal
claude mcp add --transport http ranuk12-ada-audits https://audit.ranuk.dev/mcpCursor.cursor/mcp.json
{"mcpServers":{"ranuk12-ada-audits":{"type":"http","url":"https://audit.ranuk.dev/mcp"}}}在 Cursor 中打开VS Code.vscode/mcp.json
{"servers":{"ranuk12-ada-audits":{"type":"http","url":"https://audit.ranuk.dev/mcp"}}}在 VS Code 中打开Claude Desktopclaude_desktop_config.json
{"mcpServers":{"ranuk12-ada-audits":{"type":"http","url":"https://audit.ranuk.dev/mcp"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"ranuk12-ada-audits":{"serverUrl":"https://audit.ranuk.dev/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
ADA-Audits
面向 Python 项目的自动化数据无障碍审计。
📌 功能
- 扫描 Python 文件和笔记本,查找数据无障碍问题
- 检测缺失的文档字符串、类型提示和无障碍标准
- 生成包含可执行建议的报告
- 与 CI/CD 流水线集成
🚀 快速开始
按照以下步骤开始使用 ADA-Audits:
步骤 1:安装
使用 pip:
# Clone the repository
git clone https://github.com/your-org/ada-audits.git
cd ada-audits
# Install in development mode
pip install -e .
使用 Poetry:
# Clone the repository
git clone https://github.com/your-org/ada-audits.git
cd ada-audits
# Install dependencies with Poetry
poetry install
# Activate the virtual environment
poetry shell
步骤 2:创建配置文件
在项目根目录中创建 .ada-audit.yml 文件:
# .ada-audit.yml - Minimal working configuration
targets:
- src/
- notebooks/
rules:
- missing-docstring
- missing-type-hint
- accessibility-issue
output:
format: markdown
file: audit-report.md
步骤 3:运行首次审计
扫描单个文件:
ada-scan path/to/file.py
预期输出:
✓ Scanning: path/to/file.py
Found 3 issues:
[WARNING] line 15: Missing docstring for function 'process_data'
[WARNING] line 23: Missing type hint for parameter 'input_path'
[ERROR] line 45: Accessibility issue - missing alt text for image
扫描整个目录:
ada-scan src/
预期输出:
✓ Scanning directory: src/
Found 12 files to analyze
src/__init__.py .............. OK
src/main.py .................. 2 issues
src/utils.py ................. 5 issues
src/processors/base.py ....... 1 issue
src/processors/transform.py .. 4 issues
Summary: 12 issues found across 4 files
生成完整报告:
ada-audit --output report.md
预期输出:
✓ ADA Audit Report Generated
Output: report.md
Total files scanned: 12
Issues found: 15
Compliance score: 78%
📖 用法
命令行界面
| 命令 | 描述 |
|---|---|
ada-scan <path> | 扫描文件或目录,查找无障碍问题 |
ada-audit | 根据配置生成完整审计报告 |
ada-audit --output <file> | 使用自定义输出文件名生成报告 |
ada-audit --format <fmt> | 输出格式:markdown、json 或 html |
配置参考
.ada-audit.yml 的完整配置选项:
# Paths to scan
targets:
- src/ # Python source files
- notebooks/ # Jupyter notebooks
- tests/ # Test files
# Rules to apply
rules:
- missing-docstring # Functions/classes without docstrings
- missing-type-hint # Parameters without type annotations
- accessibility-issue # Accessibility standard violations
# Output settings
output:
format: markdown # Options: markdown, json, html
file: audit-report.md # Output filename
# Optional: Exclude patterns
exclude:
- "**/__pycache__/**"
- "**/migrations/**"
🤝 参与贡献
- Fork 此仓库
- 创建功能分支(
git checkout -b feature/your-feature) - 提交更改(
git commit -m 'feat: add new rule [ranukita:xxxxx]') - 推送到该分支(
git push origin feature/your-feature) - 创建 Pull Request
📄 许可证
本项目采用 MIT License 许可,详情请参阅 LICENSE 文件。
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。