OCA / oca-addons-repo-template

OCA Repository Template
MIT License
61 stars 89 forks source link

Prepare Odoo 15 #69

Closed sbidoul closed 2 years ago

sbidoul commented 3 years ago

Upgrade linters, while avoiding unnecessary disruption which make fw/backports difficult.

sbidoul commented 3 years ago

@moylop260 et al, can you look at https://github.com/OCA/oca-addons-repo-template/blob/master/src/.pylintrc.jinja and https://github.com/OCA/oca-addons-repo-template/blob/master/src/.pylintrc-mandatory.jinja and suggest new checks to add or move for v15 ?

moylop260 commented 3 years ago

Hi @sbidoul thanks for you efforts on this

I just got the diff between the pylint-odoo checks enabled in the configuration file vs all the current ones in pylint-odoo

The diff are the following checks:

pedrobaeza commented 3 years ago

cc @Yajo

yajo commented 3 years ago

Upgrade linters, while avoiding unnecessary disruption which make fw/backports difficult.

I wonder if we should start using darker instead of black, to help on this. What do you think?

pedrobaeza commented 3 years ago

I don't think we should add another tool more to the chain, and it's not so critical to always pass pre commit in a separate previous commit.

moylop260 commented 3 years ago

There are a few of out-of-the-box pylint checks that could be good to have

sbidoul commented 3 years ago

There are a few of out-of-the-box pylint checks that could be good to have

+1 to add more on 15.0. But not on previous branches to avoid making existing branches red.

yajo commented 3 years ago

All these checks you say @moylop260 should go to mandatory or optional checks?

moylop260 commented 3 years ago

Good question

What do you think @sbidoul ?

sbidoul commented 3 years ago

I'm personally happy with adding mandatory checks in v15. We can till move them to optional if they cause problems.

yajo commented 3 years ago

I've taken a look at checks from https://github.com/OCA/oca-addons-repo-template/issues/69#issuecomment-934556722 and I've been reviewing also those from https://docs.pylint.org/en/latest/technical_reference/features.html.

I feel like we could enable the full W, R and E categories as optional checks. Since those are optional, they could be added to old versions too. WDYT?

sbidoul commented 3 years ago

I feel like we could enable the full W, R and E categories as optional checks. Since those are optional, they could be added to old versions too. WDYT?

In my experience that can becomes very noisy, like for instance the too-many-* R messages. And that could make warnings in the optional checks so numerous that people will not look at them anymore. I think if we want to do that we should at least try on some representative repos to see what it does on real OCA code.

moylop260 commented 3 years ago

@Yajo @sbidoul

FYI I'm using a configuration file to enable all the pylint checks then disable what we don't like or not valid for Odoo

This is my list:

I just share the information no action required here

sbidoul commented 3 years ago

@moylop260 thanks for sharing. At Acsone we also enable all and disable these by default.

yajo commented 3 years ago

Yikes, OK, let's leave pylint as it was 😆

We should specify a process of adding new linters in stable versions, such as adding them to optional and then, when next release is done, add them as mandatory. For the sake of simplicity, let's focus on supporting Odoo 15.0, and let's talk about this later.