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

[IMP] add pylint checkers for translation #289

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

trisdoan
Copy link
Contributor

@trisdoan trisdoan commented Dec 24, 2024

Note

  • Enabling these checks as mandatory will need some fixing work on most repos
  • So if we agree that these checks are welcome, it might be better not to enable them in mass, but repo by repo

This change

  • Since OCA/pylint-odoo@2db6690, some checkers for translation were added, by emitting translation-* instead of logging-

translation-format-interpolation
translation-format-truncated
translation-fstring-interpolation
translation-not-lazy
translation-too-few-args
translation-too-many-args
translation-unsupported-format

Result

2024-12-13_18-59

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

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

LGTM. A couple of sorting suggestions, nothing required or very critical.

src/.pylintrc.jinja Outdated Show resolved Hide resolved
src/.pylintrc-mandatory.jinja Show resolved Hide resolved
Comment on lines +68 to +75
{%- if odoo_version >= 14 %},
translation-format-interpolation,
translation-format-truncated,
translation-fstring-interpolation,
translation-not-lazy,
translation-too-few-args,
translation-too-many-args,
translation-unsupported-format
Copy link
Member

Choose a reason for hiding this comment

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

I think you'll need these changes to make it work fine:

Suggested change
{%- if odoo_version >= 14 %},
translation-format-interpolation,
translation-format-truncated,
translation-fstring-interpolation,
translation-not-lazy,
translation-too-few-args,
translation-too-many-args,
translation-unsupported-format
{%- if odoo_version >= 14 %}
translation-format-interpolation,
translation-format-truncated,
translation-fstring-interpolation,
translation-not-lazy,
translation-too-few-args,
translation-too-many-args,
translation-unsupported-format,

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

That will break too much existing stuff. Please make it a copier question (default = disabled) so PSC can enable on demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants