-
Notifications
You must be signed in to change notification settings - Fork 146
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
Introducing topics.yaml #7265
Introducing topics.yaml #7265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably link to this file from documentation somewhere.
Maybe even from https://pub.dev/topics ...
|
||
/// True, if [topic] is formatted like a valid topic. | ||
bool isValidTopicFormat(String topic) => | ||
RegExp(r'^[a-z0-9-]{2,32}$').hasMatch(topic) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we not define a regexp for this somewhere else in upload-validation code, should probably be shared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it lives in pkg/pub_package_reader, I think this is so trivial I just duplicated it rather than add another dependency.
We can change it if we want to. This is really just to test the configuration file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has a Iterable<ArchiveIssue> checkTopics(String pubspecContent)
function, which IMO should be private (or in src/
) because the only thing pub_package_reader
should expose is Future<PackageSummary> summarizePackageArchive(...)
.
So even if there was a good method we did export that we could use, I think it would be wrong to do so. pub_package_reader
is for reading packages and validating them.
One could argue we should have a separate package or library somewhere called topic_validation.dart
-- but we don't, and I'm not sure where it should live :D
Co-authored-by: Sigurd Meldgaard <sigurdm@google.com>
Co-authored-by: Sigurd Meldgaard <sigurdm@google.com>
Co-authored-by: Sigurd Meldgaard <sigurdm@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
See #7263