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

Add a minimal option to pylint --generate-toml-config #7485

Closed
cclauss opened this issue Sep 18, 2022 · 3 comments · Fixed by #7489
Closed

Add a minimal option to pylint --generate-toml-config #7485

cclauss opened this issue Sep 18, 2022 · 3 comments · Fixed by #7489
Assignees
Labels
Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@cclauss
Copy link
Contributor

cclauss commented Sep 18, 2022

Current problem

pylint --generate-toml-config can produce 500+ lines of TOML config and comments. This is a lot of text to understand, search, and edit compared to the configuration of other tools. Can we create a far less chatty version pylint --generate-toml-config that strips all settings that match the pylint default and all nonessential comments.

Desired solution

A default value trimmer could be used to slim down existing TOML configurations and/or be run as a post-process to pylint --generate-toml-config.

Additional context

pylint-dev/astroid#1793

@cclauss cclauss added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 18, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Sep 18, 2022
@DanielNoord DanielNoord self-assigned this Sep 18, 2022
@DanielNoord
Copy link
Collaborator

This will be available with #7489

It can be invoked with pylint-config generate --interactive.
To take a previous rcfile into account use pylint-config --rcfile=MYFILE generate --interactive

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Sep 19, 2022
@cclauss
Copy link
Contributor Author

cclauss commented Sep 19, 2022

Can we please reopen this issue?

I did pylint-config --rcfile=pylintrc generate --interactive . in the astroid repo and selected t and my_file.toml. The result was a 551-line file which is clearly not what this issue was targeting. The file was chock full of comments and default values and ended with three blank lines which will trigger other pre-commit tools like end-of-file-fixer.

@DanielNoord
Copy link
Collaborator

Did you use the version on the main branch? The PR that fixed this was not back ported to the just released version as it contained a new feature. We only put fixes in the patch releases to guard against potential new regressions in new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants