Skip to content

Bug: scan --format json leaks progress/warn logs to stdout #402

Closed

Description

@ajianaz

Problem

When running cora scan --format json, progress messages and warnings are printed to stdout instead of stderr, contaminating the JSON output.

Reproduction

cora scan --format json > output.json 2>/dev/null
# output.json contains non-JSON lines (WARN, progress)

Expected

--format json should output only valid JSON to stdout. All progress/warn/debug messages must go to stderr.

Root Cause

In src/commands/scan.rs, progress messages use println! (stdout) instead of eprintln! (stderr).

Impact

  • Cannot pipe --format json to jq, Python JSON parser, or any JSON consumer
  • Breaks CI pipelines that expect clean JSON
  • Affects all --format json consumers

Fix

Replace println! with eprintln! for all progress/warn messages in scan.rs when format is json. Ideally, all progress messages should always go to stderr regardless of format.

Activity

  1. added
    bugSomething isn't working
    majorMajor severity issue
    on Jul 28, 2026
  2. ajianaz commented on Jul 28, 2026

    @ajianaz
    CollaboratorAuthor

    Not reproducible. All progress/warn in scan.rs already use eprintln!. JSON output to stdout is clean. The only stdout leak is in review --stream mode (by design for live streaming). Closing as already-fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmajorMajor severity issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions