Skip to content

A report with no path is printed with its title run into the dashes #15

Description

@gilramir

Found against: gren 0.6.6, gren-lang/compiler-node 5.0.0, node 22
Reproduction: https://github.com/gilramir/gren-bug-reports/tree/main/2026-09-17-report-title-dashes

Cli.Report.toString puts a space between the title and the dashes when the
report has a path, and none when it has no path, so every path-less report the
CLI prints (INCOMPATIBLE PACKAGE, PROBLEM INSTALLING PACKAGE, CANNOT FIND COMPATIBLE VERSION, ...) reads -- TITLE-----. The compiler's own reports have
the space.

header
printed -- INCOMPATIBLE PACKAGE--------------------------------------------------------
expected -- INCOMPATIBLE PACKAGE -------------------------------------------------------

Reproduction

A node application that lists gren-lang/browser:

{
 "type": "application",
 "platform": "node",
 "source-directories": ["src"],
 "gren-version": "0.6.6",
 "dependencies": {"direct": {"gren-lang/core": "7.4.2", "gren-lang/browser": "6.0.0"}, "indirect": {"gren-lang/url": "6.0.0"}}
}

src/Main.gren:

module Main exposing (main)

import Node

main = Node.defineSimpleProgram (\_ -> Node.endSimpleProgram (Node.startProgram {}))

Output:

$ gren make Main --output=/dev/null
-- INCOMPATIBLE PACKAGE--------------------------------------------------------

gren-lang/browser targets the browser platform.

However, the current project targets the node, which is not compatible.

Also: The report's second sentence also lacks a word: "targets the node" should be
"targets the node platform".

Cause

In src/Cli/Report.gren, the Just path branch of errorBarEnd writes
" " ++ makeDashes (5 + ...) ++ " " ++ pathStr, and the Nothing branch writes
makeDashes (4 + String.unitLength title) with no space.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions