odoo-lint

io.github.bosdv0.1.0-alpha.5更新於 Oct 8, 2026

Lint and fix Odoo addons: pylint-odoo and OCA checks, translation files and upgrades.

已驗證STDIO僅桌面Developer ToolsAI & ML

概覽

AI 產生的概覽

透過本機 MCP 伺服器,讓助理檢查並自動修正 Odoo 外掛的程式碼、清單、XML 資料檔與翻譯檔。

功能
把 odl 檢查器提供給 AI 編碼代理,用來檢查 Odoo 模組的 Python、清單、XML 與 .po 翻譯問題,規則移植自 pylint-odoo 與 OCA 檢查,代碼、名稱與訊息保持一致。它可以列出並解釋規則、套用安全或不安全的自動修正、以 diff 預覽修正結果,並回報舊版 Odoo 遺留的升級問題。輸出可產生 GitHub 註解、GitLab Code Quality、SARIF 與 JSON 等 CI 格式。
適用情境
適合助理在編輯或審查 Odoo 外掛時同步發現 lint、升級與翻譯問題,也適合想在不執行 pylint 的情況下取得與 OCA pre-commit 勾子相同檢查的情境。它面向 Odoo 模組開發,而非一般 Python 專案。
執行需求
以本機 stdio 程序執行,透過 uvx 從 PyPI 套件 odoo-linter 啟動(也可用 pip、pipx 或 cargo 安裝)。僅支援桌面端;未宣告驗證、環境變數或標頭。規則與公司專屬的作者設定配置於專案的 pyproject.toml。
安裝前請注意
修正指令會修改外掛目錄中的檔案,包括不安全的修正,因此套用前應檢視 diff,並把工作內容納入版本控制。未宣告任何憑證或網路存取。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 odoo-lint,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[odoo-lint logo]

odoo-lint

[PyPI] [crates.io] [Tests] [OCA parity] [Documentation] [License: MIT]

Blazing fast Rust-native linter for Odoo modules. The command is called odl.

It checks Python files, manifests, XML data files and translation (.po) files, with the checks of OCA's pylint-odoo, oca-checks-odoo-module and oca-checks-po: same names, same messages, same results on their own test suites.

[Bar chart: linting OCA/sale-workflow takes 0.10s with odoo-lint and 25.8s with pylint-odoo]

Linting all of OCA/sale-workflow 18.0, as OCA's pre-commit hook runs pylint-odoo. See benchmarks.

  • ⚡ 250x faster than pylint with pylint-odoo, and still 30x faster on a single core
  • ⚖️ Drop-in for pylint-odoo and OCA's pre-commit checks: same codes, names and messages, 95/95 checks matching on their own test suites (Python, manifests, XML, .po), and # pylint: disable= comments keep working
  • 🔧 Automatic fixes, safe and unsafe as in Ruff, for Python, manifests, XML and .po files (odl check --fix, --diff to preview)
  • ⬆️ Upgrade checks: leftovers of older Odoo versions, such as Bootstrap 4 classes that do nothing since Odoo 15.0, with fixes
  • 🌍 Translation checks that predict Odoo's loader: why Odoo logs "malformed po file", and why a translation does not show up
  • 📦 Installable with pip, uv or pipx: one binary in prebuilt wheels for Linux, macOS and Windows, without Python dependencies
  • 🛠️ Configured in pyproject.toml, including company-specific author rules
  • 📋 Output for CI: GitHub annotations, GitLab Code Quality, SARIF and JSON
  • 🤖 For AI coding agents: an MCP server, and plugins for Claude Code, DeepSeek Harness and OpenCode that lint every file the agent edits
  • 🪝 Git hooks: pre-commit and hk

Installation

bash
uv tool install odoo-linter   # or: pipx install odoo-lintercargo install odoo-lint       # from crates.io

The PyPI package is called odoo-linter, because odoo-lint is too similar to an existing PyPI project. On crates.io it is odoo-lint.

Quick start

bash
odl check path/to/addons   # lint a directoryodl rule                   # list all rulesodl rule C8101             # explain a ruleodl check --fix            # apply the safe fixes (--diff to preview)

Rules ported from pylint-odoo keep its codes, names and messages, and # pylint: disable= comments keep working. Company-specific rules are configured in your pyproject.toml:

toml
[tool.odoo-lint]target-version = "17.0"
[tool.odoo-lint.rules.manifest-required-author.mapping]"acme_*" = "Acme Corp"

For AI coding agents there is an MCP server (odl mcp) and a post-edit hook, packaged as plugins for Claude Code (/plugin marketplace add bosd/odoo-lint), DeepSeek Harness and OpenCode.

See the documentation for all commands, configuration options and rules.

Development

bash
uv sync --all-groups   # builds odl into .venv via maturinuv run nox             # pre-commit, fmt, clippy, cargo tests, CLI tests, docs

See the development guide.

License

MIT

來源:README.md,提交 8469e21

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.0-alpha.5最新Oct 8, 2026