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

Added coverage_ignore_file option to combining_builder #636

Closed
wants to merge 1 commit into from

Conversation

darwin-morocho
Copy link

This PR allows to use a new option coverage_ignore_file in the combining_builder with this all generated files will have the next comment at the beginning

// coverage:ignore-file

This is neccessary due tojson_serializable needs this to allow us exclude the generated files from code coverage. For more info check google/json_serializable.dart#1106

@kevmoo
Copy link
Member

kevmoo commented Jan 16, 2023

Have you tried "preamble builder" - #625

I think it's better to use the general solution than to add another one-off.

Let me know if that's enough!

@darwin-morocho
Copy link
Author

Have you tried "preamble builder" - #625

I think it's better to use the general solution than to add another one-off.

Let me know if that's enough!

Yes, I do. But json_serializable doesn't support that option yet

@kevmoo
Copy link
Member

kevmoo commented Jan 17, 2023

https://github.com/google/json_serializable.dart/blob/58db73b4c2c3a0c393e4e7a68f499d28051908ac/json_serializable/build.yaml#L5-L10

It doesn't need to. You can configure source_gen separately. That way we don't have to plumb everything through.

@darwin-morocho
Copy link
Author

https://github.com/google/json_serializable.dart/blob/58db73b4c2c3a0c393e4e7a68f499d28051908ac/json_serializable/build.yaml#L5-L10

It doesn't need to. You can configure source_gen separately. That way we don't have to plumb everything through.

Amazing. I will try it

@kevmoo
Copy link
Member

kevmoo commented Jan 17, 2023

Closing out. You can reopen if things don't work.

@kevmoo kevmoo closed this Jan 17, 2023
@kevmoo kevmoo mentioned this pull request Jan 17, 2023
@patrickhammond
Copy link

Preamble worked perfectly! Relevant build.yaml configuration below:

targets:
  $default:
    builders:
      source_gen:combining_builder:
        options:
          preamble: |
            // coverage:ignore-file

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.

None yet

3 participants