Pylint-Odoo
raw JSON → 10.0.2 verified Mon Apr 27 auth: no python
Pylint plugin for Odoo. Provides a set of checkers for Odoo development, enforcing best practices and detecting common issues in Odoo modules. Current version: 10.0.2. Release cadence: irregular, major versions roughly annually.
pip install pylint-odoo Common errors
error ModuleNotFoundError: No module named 'pylint_odoo' ↓
cause The package is installed but the import path is wrong or the Python environment is different.
fix
Ensure you installed pylint-odoo in the same environment: pip install pylint-odoo
error pylint: error: no such option: --load-plugins ↓
cause Trying to use --load-plugins with an older version of pylint that doesn't support it.
fix
Upgrade pylint: pip install 'pylint>=2.0.0'
Warnings
breaking The 'attribute-deprecated' checker was removed or renamed in newer versions. ↓
fix Use 'attribute-string-redundant' or check the current list of checkers.
deprecated The 'eval-referenced' checker is deprecated and may be removed. ↓
fix Remove usage of this checker; it will be ignored in future versions.
gotcha pylint-odoo requires pylint version 2.x. Using with pylint 3.x will fail. ↓
fix Install pylint<3.0.0: pip install 'pylint<3.0.0'
Imports
- PylintOdooChecker
from pylint_odoo import PylintOdooChecker
Quickstart
import os
import pylint_odoo
pylint.lint.Run(['--load-plugins=pylint_odoo', 'my_module/'], do_exit=False)