poeditor-android-gradle-plugin icon indicating copy to clipboard operation
poeditor-android-gradle-plugin copied to clipboard

Dekekt output is not clear when it fails

Open adriangl opened this issue 3 years ago • 3 comments

SW details (please complete the following information):

  • Plug-in Version: 2.2.1

Summary and background of the bug As reported by @nokite in #37:

Btw I often have trouble with detekt. Like now when merging master into my branch. When there's a problem and the commit/merge commit is blocked, the error output is hard to read, it's all in one line 🙂 Maybe it's not correctly set up on my machine, didn't spend time on this.

Here's some output. In this case it's actually pretty short, but normally it also mentions some formatting/complexity warnings etc. (and it's all in one line)

Couldn't check the working tree for unmerged files because of an error. tput: No value for $TERM and no -T specified tput: No value for $TERM and no -T specified tput: No value for $TERM and no -T specified tput: No value for $TERM and no -T specified Running detekt > Task :detekt UP-TO-DATE Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD SUCCESSFUL in 814ms 1 actionable task: 1 up-to-date Your code is properly formatted! could not read log file '/Users/.../poeditor-android-gradle-plugin/.git/MERGE_MSG': No such file or directory

adriangl avatar Jul 20 '21 16:07 adriangl

@nokite Could you provide some data about what OS you use and the Java version on your machine so I can try debugging this?

adriangl avatar Jul 20 '21 16:07 adriangl

Sure, I'm using:

  • Mac OS 11.4 (20F71) on an Intel-based macbook
  • java 11.0.10 2021-01-19 LTS, Java(TM) SE Runtime Environment 18.9 (build 11.0.10+8-LTS-162)
  • Android Studio 4.2.2 Build #AI-202.7660.26.42.7486908, built on June 24, 2021 Runtime version: 11.0.8+10-b944.6916264 x86_64 VM: OpenJDK 64-Bit Server VM by N/A macOS 10.16

nokite avatar Jul 21 '21 10:07 nokite

To summarize the suggested improvements:

  • make sure errors are displayed on separate lines (no idea how easy this is)
  • suggest a way to run the checks from command line (as an alternative), so that the output can be seen in a more readable way

For instance, I use ktlint in my project, and it also shows a lot of noise in the small window in Android Studio. However, the nice thing is that violations are normally shown on new lines at the end, so it's relatively easy to see them. We also have a way to run the check from command line, to show the violations in a full-screen window.

nokite avatar Jul 21 '21 10:07 nokite