-
Notifications
You must be signed in to change notification settings - Fork 35
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
[Feat] Generic Way to trigger a light bulb for a code action on PyLint issues #43
Comments
And even if we don't decide to have some generic way for all linters, we should probably discuss whether we want to accept changes to this extension directly to provide quick fixes. |
One option to consider would be supporting sarif. https://sarifweb.azurewebsites.net/ Or, even just the more generic "GitHub" logging sytle: %f = filename And within the message, a suggestion can be placed between ``` like this
(space added to ` `` to display properly) |
If supporting a more commonly used standard is indeed preferred (instead of something only VS Code can use) it might make more sense to build this into |
Standardized output formats isn't going to be what helps here. The critical piece would be some mechanism to make it so you can hook into the linter results that we provide to get the quick fixes. Basically quick fixes are given the diagnostics, so you're already passed caring about how we got the diagnostic. |
I'm suggesting an additional action: to ignore the pylint rule for that line by adding the inline comment |
Additionally a second code action option for Thoughts? I can work on this. @karthiknadig @luabud |
Any news on this? |
@gilmarGNJ The extension now supports code actions. The first set of code actions (based on existing commands) is already done. The one that needed text change, can also be implemented. This is unblocked for community contributions. |
I'm able to create #300 |
Verification:
class MyObject(object):
"""Test class"""
pass
class MyObject:
"""Test class"""
pass |
I would like a generic way to specify per linter per error code to trigger a light bulb for a code action that is provided in a configuration file. Before finding a truely global way to achieve, this since PyLint handles the majority of my Python static code analysis, I would like to begin here. A subset of PyLint's suggestions could contain a suggested fix. In easy cases, this can be done by triggering a preexisting function in VSCode.
Here are some example PyLint Warnings.
Here is an example of some slightly more complex Fixes and Actions.
The HOOK into PyLint, would read the configuration file containing the list of PyLint Codes, and descriptions of the actions in VS Code.
In the above examples the following actions would be used.
Some may use a sed like REGEX to perform a transformation, use case camelCase -> snake_case.
If there is interest in developing the hook, I will continue to generate maps between PyLint Codes and VS actions. But I leave no suggested way to format the file, or hook declaration, and look for advice for that from the project owners.
The text was updated successfully, but these errors were encountered: