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

[FEATURE] Add comments around generated code with delombok #2237

Closed
satob opened this issue Sep 13, 2019 · 3 comments
Closed

[FEATURE] Add comments around generated code with delombok #2237

satob opened this issue Sep 13, 2019 · 3 comments

Comments

@satob
Copy link

@satob satob commented Sep 13, 2019

Request

Like @lombok.Generated, it is useful if delombok inserts specified comment around generated methods and field, like:

    // parasoft-begin-suppress ALL  "generated with delombok"
    @Override
    public String toString() {
        return "User(name=" + this.getName() + ", age=" + this.getAge() + ")";
    }
    // parasoft-end-suppress ALL    "generated with delombok"
    // parasoft-begin-suppress ALL  "generated with delombok"
    private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(SomeClass.class);
    // parasoft-end-suppress ALL    "generated with delombok"

The content of comment should be specified with preference like:

  <format value="generatedCodeBeginningComment:// parasoft-begin-suppress ALL &quot;generated with delombok&quot;" />
  <format value="generatedCodeEndingComment:// parasoft-end-suppress ALL &quot;generated with delombok&quot;" />

Background

Some static code analysis tools, such as Parasoft Jtest, ignore @lombok.Generated annotation. But they support suppression comment like // parasoft-begin-suppress and // parasoft-end-suppress.
cf. https://docs.parasoft.com/display/JTEST1040/Suppressing+the+Reporting+of+Findings

@rspilker

This comment has been minimized.

Copy link
Collaborator

@rspilker rspilker commented Sep 13, 2019

Wouldn't it make more sense to ask Parasoft JTest to allow for configurable Generated annotations?

It is possible to instruct delombok to insert @javax.annotation.Generated.

@satob

This comment has been minimized.

Copy link
Author

@satob satob commented Sep 18, 2019

We have already report this problem to Parasoft in Aug 2017. But unfortunately, nothing has changed for now.

@rspilker

This comment has been minimized.

Copy link
Collaborator

@rspilker rspilker commented Oct 1, 2019

Hmm, sorry. We've never heard of this tool before. So far, all other static code analyzers either respect @javax.annotation.Generated, or have configurable suppression annotations.

@rspilker rspilker closed this Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.