tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Implement Tycho warnings as custom check-style rules

Open laeubi opened this issue 3 years ago • 2 comments

Currently Tycho emits different warnings during the build in different areas:

  • Encoding warnings
  • Target platform warnings
  • P2 warnings
  • ...

Some of them might or might not be always useful. Instead of Tycho decide what should be shown to the user, we might turn all these into custom checkstyle checks:

https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/custom-developed-checkstyle.html

that way it would be possibly to control them and reuse tools that already process check-style formated files.

laeubi avatar Oct 03 '22 14:10 laeubi

I use checkstyle a lot. Still, I'm not sure if that is the best way to make the warnings optional. Probably only a minority of Tycho projects use checkstyle by now. However, all of them use Maven. Therefore writing custom maven enforcer rules would surely have a bigger "market": https://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html

I have not yet implemented Java based warnings for either of them, so I cannot compare the 2 approaches by implementation difficulty.

Bananeweizen avatar Oct 03 '22 16:10 Bananeweizen

@Bananeweizen That also seems an interesting idea. Neverless these are both "just" plugins that one needs to enable.

But I can even think about a rule "don't use restricted API", or "don't use require bundle" so maybe this can be beyond what Tycho currently offers as well!

laeubi avatar Oct 03 '22 16:10 laeubi