Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Support unnamed libraries #3730

Merged
merged 3 commits into from
Sep 27, 2022
Merged

Support unnamed libraries #3730

merged 3 commits into from
Sep 27, 2022

Conversation

srawlins
Copy link
Member

Description

Support unnamed libraries across all lint rules. The only ones which use LibraryDirective are:

  • library_names
  • package_prefixed_library_name which is just a big comment. So, easy peasy.

@github-actions github-actions bot added the linter-set-recommended Affects a rule in the recommended Dart rule set label Sep 26, 2022
@srawlins
Copy link
Member Author

@bwilkerson as far as tests, since each Dart library can only have one library directive, I think I need to convert the library_names lint rule to use reflective loader tests. Is there a good example PR of that I can follow?

@srawlins srawlins requested a review from bwilkerson September 26, 2022 20:56
@coveralls
Copy link

coveralls commented Sep 26, 2022

Coverage Status

Coverage increased (+0.0005%) to 95.68% when pulling 16fbf34 on unnamed-2 into cbe7f4e on main.

@bwilkerson
Copy link
Member

I don't know of one, but we haven't been requiring converting older tests to the new style; we have several lints with tests of both forms.

@srawlins
Copy link
Member Author

Since each Dart library can only have one library directive, I think I need to convert the library_names lint rule to use reflective loader tests, right?

@srawlins
Copy link
Member Author

I switched to unit tests; so very nice.

@srawlins srawlins merged commit 4f561a7 into main Sep 27, 2022
@srawlins srawlins deleted the unnamed-2 branch September 27, 2022 15:41
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter-set-recommended Affects a rule in the recommended Dart rule set
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants