@codacy/tools-prospector-1
v0.1.3
Published
Prospector tool adapter for Codacy analysis
Readme
@codacy/tools-prospector-1
Table of Contents
Overview
Prospector is a meta-tool for Python static analysis that orchestrates multiple linters (pylint, pyflakes, pycodestyle, mccabe, dodgy, pydocstyle) and optional tools (bandit, mypy, vulture, pyroma, pyright), running them against the same codebase and merging their output with cross-tool deduplication ("blending").
| Property | Value |
| ------------- | ---------------------------------------------- |
| Tool ID | Prospector |
| Codacy UUID | 25673894-eac1-4941-87a6-81f1abd5c321 |
| Strategy | CLI (child process via spawnTool, Python venv) |
| Languages | Python |
| File patterns | **/*.py |
Updating patterns
# Re-fetch pattern metadata from the Codacy API
pnpm prefetch
# Commit the result
git add src/patterns.jsonUpdating the Prospector version
- Update
preferredVersionandPIP_PACKAGESversion pin insrc/adapter.ts - Update pinned pylint/mypy versions if the Codacy wrapper changes them
- Run
pnpm prefetchto check for new/removed sub-tools - Run
pnpm testto verify compatibility - If the major version changes, create a new adapter package (
prospector-2/)
Development
pnpm build # Build with tsup
pnpm test # Run testsTo run integration tests locally, install prospector:
pip install prospector[with_everything]==1.18.0Notes for maintainers
Meta-tool architecture: Prospector wraps multiple sub-tools. Patterns are tool-level (e.g.
Prospector_pylint), not per-rule. Thesourcefield in Prospector's JSON output identifies which sub-tool produced each message.Blending: Prospector deduplicates equivalent messages across tools (e.g. pylint's
unused-importand pyflakes'F401). The adapter runs with blending enabled (default) to match the existing Codacy wrapper behavior.Denylist codes: Messages with codes
failure,django-not-configured, andimport-errorare filtered out, matching the existing wrapper.File chunking: Files are processed in chunks of 50 per invocation to avoid command-line length limits.
Framework detection: The adapter uses
--no-autodetectfor deterministic behavior. Django/Flask/Celery plugins are not auto-loaded.Overlap with standalone adapters: Since Prospector wraps pylint, pyflakes, etc., there is overlap with standalone adapters (e.g.
pylint-3,bandit-1). Prospector's sub-tool versions may differ from standalone adapter versions. Users should choose one approach per tool, not both.Column numbers: Some sub-tools (mccabe, dodgy) report
nullfor columns. SinceIssue.columnis required, the adapter defaults to column 1 when the sub-tool does not report a column offset.
