Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

add support for ignore_for_file comments #389

Merged
merged 2 commits into from
Dec 19, 2022
Merged

Conversation

devoncarew
Copy link
Contributor

  • add support for emitting leading line comments for libraries
  • add support for emitting ignore_for_file analyzer directive comments

@@ -398,6 +398,24 @@ class DartEmitter extends Object
@override
StringSink visitLibrary(Library spec, [StringSink? output]) {
output ??= StringBuffer();

spec.comments.map((line) => '// $line').forEach(output.writeln);
output.writeln();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Do we want an extra blank line if there were no comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope - I'll guard this w/ if (spec.comments.isNotEmpty).

@devoncarew devoncarew merged commit 7328713 into master Dec 19, 2022
@devoncarew devoncarew deleted the ignore_comments branch December 19, 2022 23:32
mosuem pushed a commit to dart-lang/tools that referenced this pull request Oct 25, 2024
* add support for ignore_for_file comments

* review comments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants