Lazily looking ahead for comments and aligns skipAndExtractComments with existing YamlEditor behaviour. The function now reverts back to the first line break it encountered when it looked ahead for comments by default
Allowing callers of skipAndExtractComments to explicitly specify whether it should greedily look ahead for comments.
Preventing the trailing line break for YamlScalars with the ScalarStyles plain, any, folded or literal from being pruned (may need additional tests to disprove ScalarStyle.PLAIN or ScalarStye.ANY)
Further changes made in #94
[x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before creating a PR.
- Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`.
- Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change).
- Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing).
Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
This PR improves #90 further by:
skipAndExtractComments
with existingYamlEditor
behaviour. The function now reverts back to the first line break it encountered when it looked ahead for comments by defaultskipAndExtractComments
to explicitly specify whether it should greedily look ahead for comments.YamlScalar
s with theScalarStyle
s plain, any, folded or literal from being pruned (may need additional tests to disproveScalarStyle.PLAIN
orScalarStye.ANY
)Further changes made in #94
Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.