Refactor PackageWarningDefinition into PackageWarning, as an enhanced enum #3547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andunknownHtmlFragment
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 #3546PackageWarning.template
,PackageWarning.warnablePrefix
, andPackageWarning.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.
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.