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] consider unsafe fixes for UP008 as safe #288

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

trisdoan
Copy link
Contributor

@trisdoan trisdoan commented Dec 5, 2024

Context

This change

Comment on lines 21 to 23
{%- if odoo_version >= 11.0 %}
extend-safe-fixes = ["UP008"]
{%- endif %}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{%- if odoo_version >= 11.0 %}
extend-safe-fixes = ["UP008"]
{%- endif %}
extend-safe-fixes = ["UP008"]

Since we don't support Odoo 10 anymore, and ruff does not support python 2 anyway no need for this version test.

@sbidoul
Copy link
Member

sbidoul commented Dec 6, 2024

Do we know if ruff UP008 preserves exoctic uses of super that we have in Odoo? Things like super(Class, self.filtered(...))._method().

@trisdoan
Copy link
Contributor Author

trisdoan commented Dec 9, 2024

Do we know if ruff UP008 preserves exoctic uses of super that we have in Odoo? Things like super(Class, self.filtered(...))._method().

Hello @sbidoul, yes it does. As long as the second argument is NOT equivalent to the first argument of the enclosing method, due to this method

For example, it does not impact this case

return super(
            QueueJob,
            self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True),
        ).create(vals_list)

@sbidoul
Copy link
Member

sbidoul commented Dec 9, 2024

Great. Let me know when you have updated the PR to remove the version test.

@OCA-git-bot
Copy link

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@sbidoul sbidoul merged commit 6ea5ca8 into OCA:master Dec 30, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants