Skip to content

Refactor PackageWarningDefinition into PackageWarning, as an enhanced enum #3547

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

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

srawlins
Copy link
Member

Previously, most of the data for a package warning kind was stuffed into a class, PackageWarningDefinition, and a map mapped the PackageWarning enum values into PackageWarningDefinition. But they should be combined into one class (enhanced enum) as they are here. Also:

  • packageWarningsByName is removed,
  • packageWarningDefinitions is removed,
  • missingExampleFile and unknownHtmlFragment both get "flag names" as part of the refactor, so they can be specified at the command line or in an options file. Fixes Expose missingExampleFile and unknownHtmlFragment warnings #3546
  • PackageWarning.template, PackageWarning.warnablePrefix, and PackageWarning.referredFromPrefix are all made private.

The diff looks huge, but I did not change any of the values from the two classes that I merged, like long help text, short help text, or flag names.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@srawlins srawlins requested a review from keertip October 23, 2023 23:03
Copy link
Collaborator

@keertip keertip left a comment

Choose a reason for hiding this comment

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

Was a bit confusing with all the diffs, your comments helped figure out the actual changes. Thanks for making it clear.

@srawlins
Copy link
Member Author

Yeah that diff was basically useless; sorry about that.

@srawlins srawlins merged commit 117a53c into dart-lang:main Oct 24, 2023
@srawlins srawlins deleted the warnings-power-enum branch October 24, 2023 19:34
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.

Expose missingExampleFile and unknownHtmlFragment warnings
2 participants