typetools / typetools/checker-framework
Idea: use ANSI colors to highlight annotation differences
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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