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.31k stars 1.14k forks source link

Propagate module config through imports #8398

Open kuwv opened 1 year ago

kuwv commented 1 year ago

Current problem

Many projects may require specific omissions from pylint that would require each consuming project to re-implement it's recommend settings. This is very difficult to do consistently.

Desired solution

Mypy uses a py.typed placeholder to signal to itself that a project dependency is supported. It would be useful if pylint allowed such a file to use to propagate settings for intended linting configuration of the module in regards to pylint.

Additional context

Domain Specific Language (DSL) written in Python may construct language idioms that do not conform to standard pylint rules. Examples such as SQL, rules (Kripke), and modified operators (such as infix).

Pierre-Sassoulas commented 1 year ago

I think the full configuration does not need to be propagated (a lib disabling missing-module-docstring does not mean you have to disable it too). Moreover merging everything from multiple libs would be impossible. On select options, that are easily merged with list addition like 'generated-members' though it would be a solution to a problem we currently solve with pylint plugins.

kuwv commented 1 year ago

@Pierre-Sassoulas Yeah, I agree. I was conceiving this an alternative to doing a separate plugin that would need to be added.