OCA / pylint-odoo

Odoo plugin for Pylint
http://www.pylint.org
142 stars 168 forks source link

Pylint-odoo not working from v8.0.6 #476

Closed celm1990 closed 10 months ago

celm1990 commented 11 months ago

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:

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?

antonag32 commented 10 months ago

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).

celm1990 commented 10 months ago

Thank you for your reply. I have created a PR at https://github.com/OCA/pylint-odoo/pull/477 This is my first contribution here. Please let me know if anything else is needed.

antonag32 commented 10 months ago

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.

antonag32 commented 10 months ago

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.

moylop260 commented 10 months ago

Fixed from https://github.com/OCA/pylint-odoo/pull/477