dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
777 stars 145 forks source link

Inconsistency in character limit for screenshot description in pubspec.yaml #7754

Closed skw398 closed 4 months ago

skw398 commented 4 months ago

There is an inconsistency between the character count check and the statement "Should be at least 10 characters". With the current implementation, a description with exactly 10 characters is not accepted.

https://github.com/dart-lang/pub-dev/blob/d8f809f5585d1c6f6bd14fb01b5f3caf1907b24c/pkg/pub_package_reader/lib/pub_package_reader.dart#L733-L736

I believe either of the following solutions could be considered:

  1. Change textLength <= 10 to textLength < 10
  2. Change Should be at least 10 characters. to something like Should be more than 10 characters. or Should be over 10 characters..

And I think any changes to the documentation are unnecessary, because the following link does not mention the character limit for screenshot descriptions. https://dart.dev/tools/pub/pubspec#screenshots

Thanks!

isoos commented 4 months ago

Thanks for reporting this! We should make it textLength < 10.

skw398 commented 4 months ago

Also, it seems that NO changes to tests are necessary.

https://github.com/dart-lang/pub-dev/blob/master/pkg/pub_package_reader/test/package_archive_test.dart#L734-L745