pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.32k stars 1.14k forks source link

Retiring checks related to old Python versions #9926

Closed akamat10 closed 2 months ago

akamat10 commented 2 months ago

Current problem

While going through the documentation, I see several checks only relevant to versions older than this repo supports. Shall those checks be retired? That would be for checks related to 3.7 or older. It will improve maintenance and simplify the user documentation.

Desired solution

Remove checks related to old versions and simplify docs.

Additional context

No response

Pierre-Sassoulas commented 2 months ago

We have a py-version option for that, so you can analyse code for python 3.2 using a 3.11 interpreter. So we drop them only if the maintenance burden become too great.

akamat10 commented 2 months ago

I see. I didn't realize that. How do we know that full list of supported versions? Does it make sense to specify and document it? Also, how does py-version with module discovery? Does it try to look into the sys.path corresponding to the version specified by py-version or the version pylint corresponds to?

jacobtylerwalls commented 2 months ago

Could you include an example?

akamat10 commented 2 months ago

Upon closer inspection, it is not high. Perhaps a couple although I will need to do a closer pass. One example is return-arg-in-generator that doesn't occur in Python 3.3 or greater. If python 3.2 or higher is support as Pierre says then it is still valid. I think we should document what the min supported version is. Happy to send a PR to update in doc if we know what the min version we want to support is.

jacobtylerwalls commented 2 months ago

That's a good find. We can probably remove return-arg-in-generator.

When @Pierre-Sassoulas says this:

We have a py-version option for that, so you can analyse code for python 3.2 using a 3.11 interpreter.

I think he's referring to the usual case where the code implementing the check still exists. With return-arg-in-generator, there is no code raising it anymore, we just have orphan docs and a message definition for it, presumably to silence unknown-option for people who still have it in their configs.

I do think it's fine to drop all references to it now, though.

Pierre-Sassoulas commented 2 months ago

We'd still need to take https://github.com/pylint-dev/pylint/issues/6670 into account before imo (keeping the doc for disabled message would be better, a lot of work went into it and it's still available forever in older pylint version; there's no reason to remove it).

jacobtylerwalls commented 2 months ago

That's fair, let's wontfix this then.