typetools / typetools/checker-framework

Idea: use ANSI colors to highlight annotation differences

Open
#3,623 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

I guess color-coding the error messages would help a lot to understand the failures.

I've implemented a Gradle plugin that color-codes test events from Gradle, and I found "bold", "bold+red foreground", "bold+blue foreground", "black bright foreground" produce good contrast in GitHub Actions (see sample), Travis (see sample), and in my terminal.

Unfortunately, it might be challenging to configure Windows terminals to support colors, so I guess it might need to be disabled by default on Windows. I tried different options to get it working in GitHub Actions+Windows, and it was challenging.

Sample message:

EnumerableValues.java:74: error: [argument.type.incompatible] inco
mpatible argument for parameter rowType of <init>.
    return new EnumerableValues(getCluster(), rowType, tuples, traitSet);
                                              ^
  found   : @Initialized @Nullable RelDataType
  required: @Initialized @NonNull RelDataType

I guess it would help if @Nullable and @NonNull were highlighted.

JdbcSchema.java:493: error: [return.type.incompatible] incompatible type
s in return.
    return getTypes().keySet();
                            ^
  type of expression: Set<@KeyFor("this.getTypes()") String>
  method return type: Set<String>

It would help if @KeyFor("this.getTypes()") was highlighted.

ViewTableMacro.java:99: error: [argument.type.incompatible] incompatible
argument for parameter names of path.
        parsed.table, Schemas.path(schema.root(), parsed.tablePath),
                                                        ^
  found   : @Initialized @Nullable ImmutableList<@Initialized @NonNull String>
  required: @Initialized @NonNull Iterable<@Initialized @NonNull String>

and so on.

WDYT?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked Gradle plugin's test-output-formatting documentation and the sample GitHub Actions and Travis output. Determine where Checker Framework error messages are produced and how ANSI support could work across terminals, especially Windows. Done means agreeing on the highlighting behavior and default platform settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.