airlift / airbase

Base POM for Airlift
Apache License 2.0
48 stars 87 forks source link

Suppress Checkstyle within text-blocks #323

Closed hashhar closed 1 year ago

hashhar commented 2 years ago

Some checks like RegexpMultiline are not AST aware and hence cannot differentiate between content inside a text-block or outside of it. This is a short term workaround which uses the """ text as a marker to let Checkstyle suppress any violations between them.

The longer term fix is to migrate away from non-AST aware checks like RegexpMultiline and RegexpSingleline to something else.

cc: @kokosing @martint

Fixes https://github.com/trinodb/trino/issues/14623

hashhar commented 2 years ago

I've been looking at some alternative checks to migrate the Regexp checks to. So far it seems EmptyLineSeparator can be configured to handle some cases but it doesn't cover everything.

If I don't find an existing check I'll try writing a new one that applies all vertical whitespace related rules we have today.

electrum commented 1 year ago

@hashhar that would be great to write a new checker that can replace the regex checks. I've wanted to do that for a while. It's probably not hard to add a new Checkstyle module to Airbase, or possibly add it into the existing airbase-policy module.

hashhar commented 1 year ago

I'd like to add it but unfortunately I'm not actively working on this at the moment. I'll probably get to it in the next week and it's free for someone else to take a shot at this until then.