Open braph opened 1 month ago
This sounds pretty good, do you have any idea how we could integrate it in pylint directly ? (Disclaimer last time I checked was in 2018 and pylint was not using argparse yet so autocomplete was not a reasonable feature at the time so I dropped https://kislyuk.github.io/argcomplete/, but I also know very little about the topic).
Hello,
I've created a pull request to add the completion files. However, I wasn’t able to test the changes in pyproject.toml
myself.
Best regards, Benjamin
Okay, it seems that this approach didn't work as expected. I apologize for the confusion. Perhaps these files need to be distributed by the package maintainers or system distributors instead.
Regards, Benjamin
Thank you for trying. I think if we integrate auto-completion in pylint we'll probably generate a file or do it directly inside pylint instead of parsing the output of the pylint help command with another tool. We need to do some kind of a state of the art of the solutions, maybe arg-complete is a way to do it after all (since we now use argparse internally).
Hello, it's me again. Sorry, I don't want to be annoying, but I wanted to clarify a few things.
You wrote:
I think if we integrate auto-completion in pylint we'll probably generate a file or do it directly inside pylint instead of parsing the output of the pylint help command with another tool.
Just to clarify:
Parsing the help text was only the first step to create the YAML definition file. It should be equivalent to what argcomplete would generate.
From the YAML definition file, the shell autocompletion files are generated in a one-time operation. The generated files can then be distributed without depending on the generation tool.
What failed in the above pull request was the attempt to distribute the files using the pyproject.toml
. The completion files themselves are working as expected.
It's important to note that even with argcomplete, you would still need to distribute a completion file to register the pylint
command for argcomplete, so the process isn't very different.
Additionally, using argcomplete would introduce a new dependency for the project.
I hope this clarifies the situation. Let me know if there's anything else I can assist with!
Best regards, Benjamin
Current problem
Hello, I'm a happy user of pylint, but there are no auto-completion files for the shell.
Desired solution
I have created auto-completion files for bash, fish and zsh using my
crazy-complete
tool.You can find the files here: https://github.com/crazy-complete/crazy-complete/tree/main/completions/pylint
The definition file was generated by parsing the output of Pylint’s --help command. A small script then enhances the file by adding the complete attribute, which defines how the argument for each option is completed.
Thanks for creating such an amazing tool!
Regards,
Benjamin Abendroth
Additional context
No response