Skip to main content

SKY-A118 · AI-code defects

Inline suppression added

Low

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) or skylos done --base origin/main (a pull request)
Quality gate
not checked (full and diff scans). No skylos . scan reports it. skylos done lists it as advice under its silenced_checks check, and it never blocks, even when that check is set to block.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

billing/refunds.py · Python · changed
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") - fee

What Skylos leaves alone

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

billing/refunds.py · Python · changed
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") - fee

Why 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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

web/cart.ts · TypeScript · changed
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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

web/cart.test.ts · TypeScript · changed
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

  1. Runs only in skylos done, as part of the silenced_checks check. It compares the base (HEAD, or the merge base with --base) with the working tree, so committed, staged, unstaged and untracked edits count.
  2. 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 as node_modules, vendor, dist and build are skipped.
  3. 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 languages NOSONAR, nosemgrep, gitleaks:allow and skylos: ignore.
  4. 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.
  5. Leaves out test files (they are counted in the summary) and generated files. Also lists _ = name (Python) and void name; (JS/TS) added where that is the variable's only use, a way to hide an unused-variable warning.
  6. 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.

Fix · Python
fee = Decimal(order.get("restocking_fee", "0"))return total * Decimal("0.5") - fee

When 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 done reads 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.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.