Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling columns in the output #11

Open
perlun opened this issue Jan 22, 2019 · 4 comments
Open

Disabling columns in the output #11

perlun opened this issue Jan 22, 2019 · 4 comments

Comments

@perlun
Copy link
Contributor

perlun commented Jan 22, 2019

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.

@tomasbjerre
Copy link
Owner

PR:s are very welcome! And using -1 as you describe sounds good!

@perlun
Copy link
Contributor Author

perlun commented Jan 22, 2019

OK, I might give it a try. 😄 What is the suggested workflow with the "multiple package" approach that this project uses, just to clone everything locally and set up local dependency overrides or what's the typical way you tend to work with this?

perlun added a commit to perlun/violations-gradle-plugin that referenced this issue Jan 22, 2019
Quick documentation fix while we are waiting on tomasbjerre#11 to be resolved. This should make it slightly more obvious how things work.
@perlun perlun mentioned this issue Jan 22, 2019
@tomasbjerre
Copy link
Owner

Yes clone this and violations-git-lib.

You can probably test it by observing the output of tests in violations-git-lib: https://github.com/tomasbjerre/violations-git-lib/blob/master/src/test/java/se/bjurr/violations/git/ViolationsReporterApiTest.java

@perlun
Copy link
Contributor Author

perlun commented Oct 13, 2020

Sorry, I never got around to doing this. We are currently moving away from the violations plugin, so it's unlikely that I will fix this.

@tomasbjerre Feel free to close this issue if you like, or keep it if you think it would make sense to put time into it. All in all, thanks for a nice plugin. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants