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

Improve dict-init-mutate msg suggestion #7819

Open
clavedeluna opened this issue Nov 22, 2022 · 1 comment
Open

Improve dict-init-mutate msg suggestion #7819

clavedeluna opened this issue Nov 22, 2022 · 1 comment
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@clavedeluna
Copy link
Collaborator

Current problem

This PR added the dict-init-mutate check with a basic msg of Declare all known key/values when initializing the dictionary.. This issue is to improve that message to read something more like Declare all known key/values when initializing the dictionary with 'config = {'dir': 'bin', 'user': 'me', 'workers': 5}' which will require building the dictionary from nodes.

Desired solution

Use suggestion provided here https://github.com/PyCQA/pylint/pull/7794/files#r1027348441 to add code to DictInitMutateChecker to improve the msg suggestion.

Additional context

No response

@clavedeluna clavedeluna added Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors 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 Nov 22, 2022
@Pierre-Sassoulas
Copy link
Member

An interesting test case:

        d = {"name": "table", "expectedrows": expectedrows}
        d["description"] = {a.cname: a.typ for a in self.axes}

Not sure of the message we should show when there is already some keys defined in the constructor.

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

No branches or pull requests

2 participants