@codacy/tools-unsupported-tools
v0.10.1
Published
Generated manifest of Codacy Cloud tools without a local analyzer (descriptors + patterns)
Readme
@codacy/tools-unsupported-tools
Table of Contents
- Overview
- What "unsupported" means
- Contents
- Framework mappings
- Regenerating the manifest
- How it's consumed
- Development
- Notes for maintainers
Overview
This package holds a generated, committed manifest of every Codacy Cloud tool
that does not have a local analyzer adapter in this CLI — the "unsupported"
(cloud-only) tools. It lets the CLI treat those tools as first-class citizens of
the configuration and of the info / analyze / init flows, even though they
are never executed locally.
What "unsupported" means
A tool is tracked here when it is in the Codacy catalog (/api/v3/tools), has no
local adapter (its UUID is not referenced by any sibling tool package's
prefetch script), and is trackable — i.e. not deprecated and not
client-side/standalone-only (those run only in the customer environment).
Descriptors carry unsupported: true, which is how the rest of the CLI tells them
apart from real adapters.
Contents
src/descriptors.json— oneAdapterDescriptorper tool (unsupported: true,uuidset,supportedRunners: ["container"]).src/patterns/<toolId>.json— that tool's full pattern set (same shape as a supported adapter'spatterns.json). Tools with no patterns have no file.src/index.ts— exportsunsupportedDescriptors(eager, tiny) andloadUnsupportedPatterns(toolId)(lazy disk read, cached).src/framework-mappings.json— hand-curated framework matching rules (see below).
Framework mappings
Several cloud-only tools ship framework-specific patterns (PHPCS → CakePHP/WordPress/Drupal/Magento/
Symfony; dartanalyzer → Flutter/Angular; SonarCSharp → ASP.NET Core/Entity Framework/xUnit/…;
CodeNarc → Grails/Spock/…). src/framework-mappings.json maps tool ID → FrameworkMappings so
init --auto can include those patterns only when the framework is actually detected (and exclude
them otherwise), exactly like supported tools.
- It is hand-curated and committed — unlike
descriptors.json/patterns/, it is not touched bygenerate, so it survives regeneration.index.tsmerges it onto each descriptor'sframeworkMappingsat load time. - Choose the mechanism per tool from its pattern shape:
prefixeswhen pattern IDs are namespaced by framework (e.g.PHPCS_CakePHP_),tagsotherwise (e.g.flutter,aspnetcore,grails). - Each key must equal the discover catalog
displayNamefor that framework (packages/runner/src/discover-catalog.ts) — that's what auto-init matches against. Add a catalog entry + manifest parser there if discover can't yet detect the framework. test/framework-mappings.test.tsenforces that every key maps to a real tool, the merge applied, and every prefix/tag still matches ≥1 committed pattern (guards against drift after regeneration).
Regenerating the manifest
From the repo root:
pnpm generate-unsupportedor from this package:
pnpm generateThe script (scripts/generate.mjs) fetches the catalog, subtracts locally
supported tools (by UUID, read from sibling prefetch scripts — no list to keep
in sync), filters out deprecated/client-side tools, and rewrites
descriptors.json + patterns/. Commit the result. On network failure it warns
and exits 0, leaving committed files untouched.
Run this whenever Codacy adds/removes tools or you implement a new local adapter (which should then disappear from this manifest on the next regeneration).
How it's consumed
packages/cli/src/index.tsregisters every descriptor viaregisterUnsupportedTool()so they appear ingetRegisteredDescriptors().init --autocallsloadUnsupportedPatterns()to fill cloud-only tools offline.init --remote/--defaultfetch patterns from the API at runtime, so they do not read this package's pattern files — only its descriptors/registration.
Development
pnpm build # tsup bundle + copy src/patterns → dist/patterns
pnpm test # manifest shape + drift invariants
pnpm lintloadUnsupportedPatterns reads dist/patterns/<toolId>.json at runtime
(__dirname-relative) and src/patterns/ during tests.
Notes for maintainers
- The patterns directory is recreated on every
generaterun so removed tools don't leave stale files behind. - The package is named with the
@codacy/tools-prefix on purpose: the CLI keeps those external from its bundle, so__dirnameresolves to this package's owndist/and the pattern files are found. filePatternsis["*"]for all entries — unsupported tools never route files locally, so the value is cosmetic.
