SKY-A118 · AI-code defects
Inline suppression added
An inline suppression is a comment or attribute that tells a linter, type checker or scanner to look away from one line or file: # noqa, # type: ignore, @ts-ignore, // eslint-disable, //nolint, #[allow(...)], @SuppressWarnings. SKY-A118 lists the suppressions a change adds to code.
- Languages
- Python, JavaScript/TypeScript (also Vue, Svelte, Astro), Go, Rust, Java/Kotlin, C#
- Turned on by
skylos done(uncommitted changes) orskylos done --base origin/main(a pull request)- Quality gate
- not checked (full and diff scans). No
skylos .scan reports it.skylos donelists it as advice under itssilenced_checkscheck, and it never blocks, even when that check is set toblock. - Finding type
- review
Why it matters
A coding agent that cannot make a check pass can silence it instead. The build turns green while the type error or lint warning is still there, and a reviewer sees only a short comment at the end of a line.
What Skylos flags
from decimal import Decimal def refund_amount(order, reason): total = Decimal(order["total"]) if reason == "damaged": return totalRemoved: return total * Decimal("0.5")Added: fee = order.get("restocking_fee") # type: ignoreAdded: return total * Decimal("0.5") - feeWhat Skylos leaves alone
from decimal import Decimal def refund_amount(order, reason): total = Decimal(order["total"])Removed: if reason == "damaged":Added: if reason in ("damaged", "late"): return totalRemoved: fee = order.get("fee") # type: ignore[union-attr]Added: fee = order.get("restocking_fee") # type: ignore[union-attr] return total * Decimal("0.5") - feeWhy Skylos leaves it alone
The # type: ignore[union-attr] was already in the file. The change edited that line but the file holds no more of that suppression than before, so nothing new was silenced.
More languages
TypeScript
Flagged
export function cartTotal(items: Array<{ price: number; qty: number }>) { let total = 0; for (const item of items) {Removed: total += item.price * item.qty;Added: // @ts-ignoreAdded: total += item.price * item.quantity; } return total;}Not flagged
import { cartTotal } from "./cart"; test("sums price times quantity", () => { expect(cartTotal([{ price: 3, qty: 2 }])).toBe(6);});Added: Added: test("rejects a missing quantity", () => {Added: // @ts-expect-error qty is requiredAdded: expect(() => cartTotal([{ price: 3 }])).toThrow();Added: });Why Skylos leaves it alone
Tests pass wrong types on purpose to check that code rejects them. Suppressions added in test files are counted in the summary, not listed.
How Skylos decides
- Runs only in
skylos done, as part of thesilenced_checkscheck. It compares the base (HEAD, or the merge base with--base) with the working tree, so committed, staged, unstaged and untracked edits count. - Reads changed Python, JavaScript/TypeScript (also
.vue,.svelte,.astro), Go, Rust, Java/Kotlin and C# files that have added lines. Type declaration files (.d.ts) and vendored folders such asnode_modules,vendor,distandbuildare skipped. - Finds suppression directives in comments and attributes, per language: for example
# noqa,# type: ignore,# pyright: ignore,# mypy: ignore-errors,# pylint: disable,# nosec,# pragma: no cover,eslint-disable,@ts-ignore,@ts-nocheck,//nolint,#[allow(...)],@SuppressWarnings, C##pragma warning disable, and in any of these languagesNOSONAR,nosemgrep,gitleaks:allowandskylos: ignore. - Counts a directive only when it sits on a line the change added and the file now holds more of that directive than at the base. A suppressed line that was moved, reindented or edited elsewhere in the change is matched against the base and not counted.
- Leaves out test files (they are counted in the summary) and generated files. Also lists
_ = name(Python) andvoid name;(JS/TS) added where that is the variable's only use, a way to hide an unused-variable warning. - Each finding says which suppression was added, quotes its reason if it has one, and says when a whole-file directive stops a tool checking a file. At most 20 are listed; every finding is advice.
How to fix it
Fix what the tool reported instead of silencing it. Here the order may have no fee, so give the lookup a default. If a suppression really is right, narrow it to one rule and write the reason after it, so the reviewer can judge it.
fee = Decimal(order.get("restocking_fee", "0"))return total * Decimal("0.5") - feeWhen it can be wrong
- A deliberate, explained suppression is still listed, with its reason quoted. That is intended: the finding is advice for the reviewer.
- A file whose name or folder does not look like a test (a helper under
fixtures/, say) is treated as code, so its suppressions are listed.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Turn the whole check off in the base branch's
pyproject.toml. This also stops SKY-A119 and SKY-A121, which share the check.skylos donereads its settings from the base, never from the change.TOML [tool.skylos.done.checks]silenced_checks = "off"A
# skylos: ignore[SKY-A118]comment does not help: it is itself an added suppression.