Instagram / Fixit

Advanced Python linting framework with auto-fixes and hierarchical configuration that makes it easy to write custom in-repo lint rules.
https://fixit.rtfd.io/en/latest/
Other
669 stars 61 forks source link

Integrate Fixit into a VSCode plugin #122

Open jimmylai opened 4 years ago

jimmylai commented 4 years ago

Integrate Fixit into a VSCode plugin (and potentially any other IDE), so developer can easily install it and use it on VSCode.

Fixit can be run automatically when developers save source file updates and show warning inline with wavy underline or lightbulb UIs.

Then developers can click on the UI or press some shortcut to apply autofix.

Some helper is provided to make this easy to implement, e.g. lint_file returns a list of violation reports (BaseLintRuleReport) and provides patch property when autofix is available.

https://github.com/Instagram/Fixit/blob/master/fixit/rule_lint_engine.py#L54

llllvvuu commented 1 year ago

Here's a rather janky way to get VSCode diagnostics on load/save: https://github.com/llllvvuu/efm-tool-definitions.yaml/blob/cb90f12516a27a8e1820600afe94229c04bb5c19/tool-definitions.yaml#L42-L55

The above becomes lint-as-you-type if https://github.com/Instagram/Fixit/pull/388 is merged.

That leaves the remaining task of supporting Code Actions, which requires implementing LSP: #387 (EDIT: PR up)