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.25k stars 1.12k forks source link

Auto-upgrade the ``whitelist`` and ``blacklist`` options in configuration #5465

Open Talador12 opened 2 years ago

Talador12 commented 2 years ago

Current problem

In .pylintrc we have the following attribute

extension-pkg-whitelist=

For context, here is a description of that

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
# for backward compatibility.)

At what point do we end backwards compatibility on this term? It is worth deprecating that language at some point.

Desired solution

We should deprecate extension-pkg-whitelist in favor of extension-pkg-allow-list for all references

Additional context

Lots of different inclusivity guides out there, but here's one https://developers.google.com/style/inclusive-documentation

Talador12 commented 2 years ago

If anyone can find other references of language that should be deprecated, please add examples to this ticket.

Pierre-Sassoulas commented 2 years ago

This has been answered in detail in the initial MR, in particular here and here:

We're never going to break compatibility for the old name. That would be forcing maintenance work on pylint users for political reasons.

So to do that partially would requires #5462. You're welcome to contribute to it if you like.

Talador12 commented 2 years ago

I disagree that this would be considered political reasons as this is more about ethics than politics. I will add to #5462

Talador12 commented 2 years ago

@Pierre-Sassoulas One more case to consider

pylintrc uses [MASTER] at the top of the file. Could this be changed to [MAIN] ? Currently it appears to only allow [MASTER]. We can keep the backwards compatibility if that is the stance of pylint.

Pierre-Sassoulas commented 2 years ago

Please read the initial MR provided and the two comments linked in particular.

Talador12 commented 2 years ago

I had read the MR and two comments you had linked.

Confirmed that an updated pylint version has [MAIN] compatibility.

However, I did notice that pylint --generate-rcfile still uses [MASTER] terminology by default.

Since [MAIN] is compatible, it should be the default for pylint --generate-rcfile going forward.

Pierre-Sassoulas commented 2 years ago

No. Please take the time to read the existing discussion properly. You previously answered that you disagreed in 4mn so clearly you did not. You also misunderstood what you read the second time around. A config file with '[main]' instead of '[master]' would not work right now. The following is still true:

Changing the "master" in the options and configuration would break compatibility with all the pylint configuration files ever written. This would impact a huge amount of person and would make a lot of documentation and question on stackoverflow and everywhere else obsolete. [...] it need to be done as a breaking change for 3.0. I expect those kind of changes to be included in a big refactor of the configuration and option parser to use something modern like click or argparse and pyproject.toml that would affect pylint, but also pylint integration in emacs and other editor.

See #5392 and #5462

DanielNoord commented 2 years ago

I have put in a a PR to fix https://github.com/PyCQA/pylint/issues/5467.

I'm going to refocus this issue to deprecating whitelist and blacklist. For any other language updates please open separate issues. Please keep those very specific about issues you have identified instead of a larger call for "examples to deprecate". 😄

Pierre-Sassoulas commented 2 years ago

Wasn't this particular issue fixed in https://github.com/PyCQA/pylint/pull/3961 ?

DanielNoord commented 2 years ago

Partially, we now offer support for the new options but the suggestion in this issue is to deprecate the old options (and then remove them in a later version). With the new_names stuff added with argparse we can now actually deprecate options so this is something we can do. We already did the same for black_list.

Pierre-Sassoulas commented 2 years ago

Blocked by #5462