Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] pre-commit: update pylint odoo to enable valid-odoo-versions key for v18 #280

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions src/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{%- set repo_rev.pyupgrade = "v2.29.0" %}
{%- set repo_rev.ruff = "v0.1.3" %}
{%- set repo_rev.setuptools_odoo = "3.1.8" %}
{%- elif odoo_version < 18 %}
{%- elif odoo_version < 17 %}
{%- set repo_rev.autoflake = "v1.6.1" %}
{%- set repo_rev.black = "22.8.0" %}
{%- set repo_rev.eslint = "8.24.0" %}
Expand All @@ -55,6 +55,23 @@
{%- set repo_rev.pyupgrade = "v2.38.2" %}
{%- set repo_rev.ruff = "v0.1.3" %}
{%- set repo_rev.setuptools_odoo = "3.1.8" %}
{%- elif odoo_version < 18 %}
{%- set repo_rev.autoflake = "v1.6.1" %}
{%- set repo_rev.black = "22.8.0" %}
{%- set repo_rev.eslint = "8.24.0" %}
{%- set repo_rev.flake8 = "3.9.2" %}
{%- set repo_rev.flake8_bugbear = "21.9.2" %}
{%- set repo_rev.isort = "5.12.0" %}
{%- set repo_rev.maintainer_tools = "d5fab7ee87fceee858a3d01048c78a548974d935" %}
{%- set repo_rev.nodejs = "16.17.0" %}
{%- set repo_rev.odoo_pre_commit_hooks = "v0.0.25" %}
{%- set repo_rev.pre_commit_hooks = "v4.3.0" %}
{%- set repo_rev.prettier = "2.7.1" %}
{%- set repo_rev.prettier_xml = "2.2.0" %}
{%- set repo_rev.pylint_odoo = "v9.0.4" %}
{%- set repo_rev.pyupgrade = "v2.38.2" %}
{%- set repo_rev.ruff = "v0.1.3" %}
{%- set repo_rev.setuptools_odoo = "3.1.8" %}
{%- else %}
{%- set repo_rev.autoflake = "v1.6.1" %}
{%- set repo_rev.black = "22.8.0" %}
Expand All @@ -69,16 +86,12 @@
{%- set repo_rev.pre_commit_hooks = "v4.6.0" %}
{%- set repo_rev.prettier = "3.3.3" %}
{%- set repo_rev.prettier_xml = "3.4.1" %}
{%- set repo_rev.pylint_odoo = "v9.1.2" %}
{%- set repo_rev.pylint_odoo = "v9.1.3" %}
{%- set repo_rev.pyupgrade = "v2.38.2" %}
{%- set repo_rev.ruff = "v0.6.8" %}
{%- set repo_rev.setuptools_odoo = "3.1.8" %}
{%- endif %}

{%- if odoo_version > 16 %}
{%- set repo_rev.pylint_odoo = "v9.0.4" %}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing this v17 will have pylint_odoo = "v8.0.19" instead of "v9.0.4"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{%- if odoo_version == 17 %}
{%- set repo_rev.pylint_odoo = "v9.0.4" %}
{%- endif %}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, miss interpreted the conditions. So if v9.0.4 only applies to 17, we shouldn't remove the condition but instead modify to check for 17 only. In the previous state, the v9.1.2 for v17 and v18 were changed back to v9.0.4.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tihs is indeed easy to miss. I'd prefer adding a whole new section for v17, even if all the versions are identical to 16. So it is systematic, and easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new section for v17 was added

{%- endif %}

{#- Older versions that differ a lot have their own hardcoded templates for readability #}
{%- if odoo_version < 13 %}
{%- include "version-specific/mqt-compat/.pre-commit-config.yaml.jinja" %}
Expand Down
Loading