Targets
Configured target languages, and the code generated for them.
| Rule | Default | Summary |
|---|---|---|
Target/InvalidGeneratedCode |
error |
A generated SDK contains code that cannot compile. |
Target/NotRegistered |
warn |
A configured target has no generator. |
Target/InvalidGeneratedCode
A generated SDK contains code that cannot compile.
| Default severity | Fix lives in |
|---|---|
error |
The generator (internal) |
When it fires
A target's generated code fails the compile check that runs after it is generated, so that target fails and its files are not written, while every other target is. Only Go has a check today: a generated sample assigning a struct field a type its declaration does not have. This is a generator bug: contact Scalar support, unless a reported site is a go fence in a README section you configured (readme.sections), whose body you fix. Suppressing it ships code that does not compile. See After generation.
Changing or silencing it
Each finding's suppression key is the declaration that fails, such as CreateParams.Owner.
Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:
{
"diagnostics": {
"rules": {
"Target/InvalidGeneratedCode": "warn"
},
"ignored": {
"Target/InvalidGeneratedCode": "<suppression key>"
}
}
}
Target/NotRegistered
A configured target has no generator.
| Default severity | Fix lives in |
|---|---|
warn |
Your SDK configuration (config) |
When it fires
The configuration declares a target that has no generator, so the target is skipped instead of built.
Changing or silencing it
Each finding's suppression key is the target id, such as go.
Re-grade the rule with diagnostics.rules, or silence findings with diagnostics.ignored, matching their suppression key exactly or with * as a wildcard:
{
"diagnostics": {
"rules": {
"Target/NotRegistered": "info"
},
"ignored": {
"Target/NotRegistered": "<suppression key>"
}
}
}
See also
- Diagnostics: how findings are graded, located and suppressed
- Severity and failing the build
- Suppressing a finding
What did you think of this content?