Skip to content

Revert "coverage - ignore file" addition because it results in less flexibility #169

@JanMichaelPeter

Description

@JanMichaelPeter

Describe the bug
We added a line "coverage - ignore file" to generated code in #104
This works fine if widget driver is the only generator that produces code. But for example if I combine widget_driver and json_serializable I run into a problem:
widget_driver writes the ignore coverage comment by default while I need to customize the build_runner from json_serializable with a preamble inside build.yaml see this reference. If I do both, I end up with two "coverage - ignore file" comments in all widget_driver generated files.

To Reproduce
Steps to reproduce the behavior, e.g.:

  1. have json_serializable and widget_driver_generator in class
  2. create a driver that triggers the generation of a file
  3. add this to the build.yaml
targets:
  $default:
    builders:
      source_gen:combining_builder:
        options:
          preamble: |
            // coverage:ignore-file
  1. run dart run build_runner build --delete-conflicting-outputs
  2. Observe two "coverage - ignore file" comments in generated driver files
    Expected behavior
    No "coverage - ignore file" comments in generated driver on default. I want only the option to set it with the pramble

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions