Visual Studio Code plugin for Prospector
As part of my efforts to improve Prospector's integration with popular IDEs, I created a Visual Studio Code plugin based on the Linter plugin. While this plugin is not actively maintained, it was a valuable tool for quickly building a new plugin that integrates Prospector with VS Code.
The plugin provides a seamless experience for users to run Prospector directly from within VS Code and see linting results instantly in the editor.
Result:
Available in the Visual Studio Code Marketplace.
What is Prospector
Prospector is a powerful bundler of various linting tools for Python, designed to improve code quality by running multiple linters and static analysis tools in a single pass. It integrates a collection of popular tools, which can be easily configured and customized to fit your project’s needs. You can explore the full list of Supported Tools.
Over the past few years at Camptocamp, we have contributed several improvements to Prospector, including:
- Python 3.12 compatibility: Ensuring Prospector works seamlessly with the latest version of Python.
- Adding Ruff support: Integrating Ruff, a fast linter for Python, to improve linting performance.
- Improved Bandit and Mypy integration: Enhancing the integration of Bandit (security-focused static analysis) and Mypy (static type checking).
- Support for profiles in PyPI packages: Allowing users to publish Prospector profiles as PyPI packages.
- Bug fixes: Addressing various issues to make the tool more reliable.
Latest Prospector version
In the most recent release of Prospector, I focused on improving the integration with IDEs, particularly by enhancing the JSON output generated by Prospector. These improvements allow for better interaction with code editors and IDEs like Visual Studio Code:
- Line and character end information: This change allows the IDE to highlight the entire element (e.g., a function or variable) that has an issue, rather than just the first character. This provides a more intuitive user experience when reviewing linting errors.
- Documentation URL: A new addition that provides a direct link to the relevant documentation for each linting rule. This allows developers to quickly understand and resolve issues without having to search for the documentation manually.
Useful related packages I maintain
- Base Prospector profiles A set of basic profiles to help configure Prospector for your project.
- Prospector profiles used to avoid duplicated messages A collection of profiles designed to prevent duplicate linting messages, making the output more concise and easier to understand.
Top comments (0)