Skip to content

Disabling columns in the output #11

@perlun

Description

@perlun

Hi, thanks again for a nice plugin. 😄

The README.md for this repo states that you can set the maxReporterColumnWidth to 0 to "disable" it. I got the impression from this that you could disable an individual column altogether (which would be useful, especially to give room for "more important" columns - the maxRuleColumnWidth is what I'm after more specifically, since the rule names can be very long with Checkstyle).

task violations(type: se.bjurr.violations.gradle.plugin.ViolationsTask) {
 //
 // Optional config
 //
 maxReporterColumnWidth = 0 // 0 is disabled

However, when looking more closely at the code, I realize that this is not what you mean with "disabled" here - rather, you mean that the max width feature is disabled, not the column altogether.

  private String addNewlines(final String message, final int maxLineLength) {
    if (message == null) {
      return "";
    }
    if (maxLineLength <= 0) {
      return message;
}

It would be useful to be able to drop a column completely. Our typical use case is when running Checkstyle and Spotbugs on our CI server; I would like the Message and the affected file/line to be shown, as well as the Reporter, but not so much more.

Since 0 is already used for "disable limit", how about letting -1 indicate that "column should be dropped"? I might be able to put together a PR if you are fine with the idea, but I want to check first what you think about it.

If you want to do it yourself, feel free - you know the code base much better than me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions