Skip to content

Conversation

@travis-mortimer
Copy link
Contributor

This seems to be a common question that is quite difficult to answer. The most visible solution I found previously was to use the remove_from_coverage package to remove generated files from the coverage report. That solution complicates CLI commands and may require updating CI/CD pipelines.

This seems to be a common question that is quite difficult to answer. The most visible solution I found previously was to use the `remove_from_coverage` package to remove generated files from the coverage report. That solution complicates CLI commands and requires updating CI/CD pipelines.
@google-cla
Copy link

google-cla bot commented Jan 31, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kevmoo
Copy link
Collaborator

kevmoo commented Feb 3, 2025

@travis-mortimer – you need to update the template file and re-run build. The readme is generated!

@kevmoo
Copy link
Collaborator

kevmoo commented Feb 4, 2025

@travis-mortimer – you'll need to re-run the build, too

dart run build_runner build

@travis-mortimer
Copy link
Contributor Author

@travis-mortimer – you'll need to re-run the build, too

dart run build_runner build

I did run that command and the generated readme was (apparently) identical to what I had previously committed. When I attempted to stage the file, it disappeared.

I also saw this error

[SEVERE] json_serializable:_type_test_builder on test/supported_types/type_test.dart:

RangeError (end): Invalid value: Not in inclusive range 425..2020: 29
dart:core                           _StringBase.substring
tool\test_type_data.dart 198:40     TestTypeData.testContent
tool\test_type_builder.dart 170:21  _TypeTestBuilder.build

and ~47 input.type_* files under json_serializable\test\supported_types were modified. None of the changes looked valid.

Here is a sample:
image

Can you help me better understand what changes are expected from running the build after updating the template?

@kevmoo
Copy link
Collaborator

kevmoo commented Feb 4, 2025

Are you on a windows machine, @travis-mortimer ?

The readme is generated from the template. And I check that the root readme is in sync w/ the template as part of CI. So both files should be updated w/ your change. Ideally the root readme is updated by running the builder on your dev machine, but hand editing both should work, too.

Have you run pub upgrade first?

@travis-mortimer
Copy link
Contributor Author

travis-mortimer commented Feb 4, 2025

Are you on a windows machine, @travis-mortimer ?

The readme is generated from the template. And I check that the root readme is in sync w/ the template as part of CI. So both files should be updated w/ your change. Ideally the root readme is updated by running the builder on your dev machine, but hand editing both should work, too.

Have you run pub upgrade first?

Yes I am, though I have access to a mac if we expect running it on that machine will yield better results. I did not run pub upgrade first. I'm interested in getting it to work the "right" way, but you let me know if at any point you'd rather try the hand edit and I'll make the change.

UPDATE: I see the same error when running the build after a pub upgrade. I'll try it on a mac tomorrow and get back to you.

UPDATE UPDATE: When you say "root" readme, do I assume correctly that you are referring to the root of the json_serializable directory, and not of the monorepo?

@kevmoo I ran it on a mac without error, but there were no differences from the hand-edit. Are there any other changes you'd like me to make?

@travis-mortimer
Copy link
Contributor Author

@kevmoo Are there any other changes you'd like me to make?

@kevmoo
Copy link
Collaborator

kevmoo commented Mar 3, 2025

thanks for your patience here @travis-mortimer . Trying to kick it a bit from my side...

@kevmoo kevmoo merged commit a4edc02 into google:master Mar 3, 2025
18 checks passed
vkorencik pushed a commit to TypeSoft-Ltd/json_serializable.dart that referenced this pull request Sep 11, 2025
This seems to be a common question that is quite difficult to answer. The most visible solution I found previously was to use the `remove_from_coverage` package to remove generated files from the coverage report. That solution complicates CLI commands and requires updating CI/CD pipelines.
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.

2 participants