OCA/pylint-odoo

Pylint-odoo not working from v8.0.6

Closed this issue · 5 comments

Describe the bug

I have a module with some inconsistencies, but pre-commit with pylint-odoo v8.0.6(to lastest version) not fails. I try various versions and to v8.0.5 working fine

To Reproduce

Affected versions:
v8.0.6 +

Steps to reproduce the behavior:

  1. Create a new module with some inconsistences(I generate repo template from oca-addons-repo-template and this use v8.0.19 for Odoo 17.0 see here
  2. execute pre-commit run -a or try git commit

Expected behavior
pylint-odoo must be fails because:

  • The manifest version is wrong(16.0 instead of 17.0)
  • Text untranslated

Additional context
Please see repo where pre-commit not fail(pylint-odoo with lastest version)
https://github.com/celm1990/repo_with_ruff/actions/runs/6841841712/job/18602672369

And this log i change pylint-odoo to v8.0.5 and now working and pre-commit fails
https://github.com/celm1990/repo_with_ruff/actions/runs/6842135353/job/18603271696

I not sure if after this commit is need a extra args on pre-commit to pylint-odoo?

Thanks for reporting. This is happening because 17.0 has not been added yet to pylint-odoo as a valid odoo version. I will create the PR to do so, once added it should work (already tested locally).

Thank you for your reply. I have created a PR at #477 This is my first contribution here. Please let me know if anything else is needed.

Thank you for your reply. I have created a PR at #477 This is my first contribution here. Please let me know if anything else is needed.

I created a PR as well which is basically the same as yours. Only thing missing in yours is running tox -e update-readme, to automatically update the readme (that will fix the CI). Try that out and once your MR goes green I can close mine and get your first contribution going.

Also, with this diff you should be able to test the changes before we merge them:

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b1359da..6b0d277 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -109,8 +109,8 @@ repos:
       - id: ruff
         args: [--fix, --exit-non-zero-on-fix]
       - id: ruff-format
-  - repo: https://github.com/OCA/pylint-odoo
-    rev: v8.0.19
+  - repo: https://github.com/Vauxoo-dev/pylint-odoo
+    rev: 635e7867422b7b9e63a61aae7bed2b52cdd93b8d
     hooks:
       - id: pylint_odoo
         name: pylint with optional checks

Try that out locally and see if it works.

Fixed from #477