Skip to content

Fix lints and tests. #4070

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 3 commits into from
Jul 1, 2025
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [3.7.0, dev]
sdk: [3.8.0, dev]
job: [main, flutter, packages, sdk-docs]
include:
- os: macos-latest
Expand All @@ -35,9 +35,9 @@ jobs:
# Do not try to run flutter against the "stable" sdk,
# it is unlikely to work and produces uninteresting
# results.
- sdk: 3.7.0
- sdk: 3.8.0
job: flutter
- sdk: 3.7.0
- sdk: 3.8.0
job: sdk-docs

steps:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/canonicalization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ final class _Canonicalization {
Element2? ancestor = element;
while (ancestor != null) {
if (ancestor is LibraryElement2) {
components.insert(0, ancestor.identifier);
components.insert(0, ancestor.uri.toString());
} else {
components.insert(0, ancestor.name3!);
}
Expand Down
9 changes: 5 additions & 4 deletions lib/src/model/model_element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,12 @@ abstract class ModelElement
return false;
}

if (element case LibraryElement2(:var identifier, :var firstFragment)) {
if (element case LibraryElement2(:var uri, :var firstFragment)) {
final url = uri.toString();
// Private Dart SDK libraries are not public.
if (identifier.startsWith('dart:_') ||
identifier.startsWith('dart:nativewrappers/') ||
'dart:nativewrappers' == identifier) {
if (url.startsWith('dart:_') ||
url.startsWith('dart:nativewrappers/') ||
url == 'dart:nativewrappers') {
return false;
}
// Package-private libraries are not public.
Expand Down
2 changes: 1 addition & 1 deletion test/end2end/dartdoc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void main() {
expect(
useSomethingInAnotherPackage.modelType.linkedName,
matches(
r'<a class="deprecated" href="https://pub.dev/documentation/meta/[^"]*/meta/Required-class.html">Required</a>'));
r'<a class="deprecated" href="https://pub.dev/documentation/meta/[^"]*/meta/Required-class.html">Required</a>\?'));
var link = RegExp('/dart-core/String-class.html">String</a>');
expect(useSomethingInTheSdk.modelType.linkedName, contains(link));
});
Expand Down