Give option for detailed linting errors

Open
#2,455 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, scala
Domain
tooling

Research direction

Use the linked CI run and the .scalafmt.conf version mismatch as the reproduction context. Trace the Scala/Scalafmt lint-error reporting path and existing configuration options; done means users can opt into stack traces for linting errors without changing the default output.

Written by the indexing model from the issue text.

Description

enhancement

After upgrading to version 7, spotless just kept crashing when linting Scala in spotlessCheck/Apply, with a cryptic error message:

There were 411 lint error(s), they must be fixed or suppressed.
  src/main/scala/edu/ie3/simona/actor/ActorUtil.scala:LINE_UNDEFINED scalafmt(java.lang.reflect.InvocationTargetException) java.lang.reflect.InvocationTargetException (...)
[...]

(CI run here)

Turns out the cause of our problem was that the scalafmt version was not set to the exact one required (3.8.1) in .scalafmt.conf. It took me some time to figure this out, so maybe there's a way to make the error logging more verbose. Giving an option to print the stack traces of linting errors would be great, for example (my apologies if this option exists already, I have not found it).

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

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.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.