Skip to content

Conversation

@anessi
Copy link

@anessi anessi commented Jun 30, 2025

Description

Use parameter generateTimestamp to suppress timestamp in @Generated annotation, see #433

Related issue(s)
Fixes #433

@cdm-phm
Copy link

cdm-phm commented Jul 1, 2025

I really like this option but maybe it would be better the current behaviour as default and make it opt-in, especially if it is for a patch release. Also, parameters should be listed in the README.

@anessi anessi force-pushed the fix-433 branch 3 times, most recently from 86333c2 to 1d9f243 Compare July 1, 2025 11:14
@anessi
Copy link
Author

anessi commented Jul 1, 2025

Added a default value for generateTimestamp and set it to true. The parameter is now listed in the README and can be changed by adding -p generateTimestamp=false on the CLI.

@Tenischev
Copy link
Member

@anessi Thank you for the contribution!
Could you please add a new test case for your parameter to the parameters.test.js?

@Tenischev Tenischev self-assigned this Jul 1, 2025
@anessi
Copy link
Author

anessi commented Jul 9, 2025

I added 2 tests.
As mentioned in the other PR I had serious troubles running the tests reliably. This seems to be a known problem: https://stackoverflow.com/questions/76203449/a-jest-worker-process-was-terminated-by-another-process

I suggest to update the README.md with the following notes:

  • Running the tests sequentially: npm test -- --runInBand --no-cache
  • Running the tests with Docker: docker run --rm -it -v "$PWD":/app -w /app node:24 bash -c "npm install && npm test -- --runInBand --no-cache"
  • Running a single test: npm test -- --runInBand --no-cache -t "should include timestamp in @Generated annotation when generateTimestamp is true"

This will help Java devs that are not very familiar with Node.

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

Successfully merging this pull request may close these issues.

[FEATURE] Add parameter to suppress timestamp in @Generated annotation

3 participants