Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/unit/tooling/pub_content_limits_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ void main() {
});
}

for (final MapEntry(key: name, value: path) in _packages.entries.skip(1)) {
test('fails an oversized $name README', () {
write('$path/README.md', pubContentLimitBytes + 1);
final result = verify(releasePrep: false);
expect(result.exitCode, 1);
expect(
result.stderr,
contains('- $path/README.md is 262145 bytes; pub.dev rejects $name'),
);
});
}

test('passes a changelog under the limit', () {
write('CHANGELOG.md', pubContentLimitBytes);
final result = verify(releasePrep: false);
Expand Down
5 changes: 5 additions & 0 deletions tool/release/pub_content_limits.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const int pubContentWarningBytes = pubContentLimitBytes * 9 ~/ 10;
/// The content files of package [name] at [packagePath], relative to the
/// repository root, that pub.dev reads: `README.md`, `CHANGELOG.md`, `LICENSE`
/// and the first example file its Example tab would show.
///
/// Candidates are chosen by existence on disk. `.pubignore` is not consulted
/// (it is gitignore syntax, and no candidate is ignored today), so a
/// pub-ignored higher-priority example would make this check size a file that
/// pub.dev never shows.
List<String> pubContentFiles(
Directory repoRoot,
String packagePath,
Expand Down
Loading