Skip to content
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

Deprecate the --nodoc Option #3690

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 9 additions & 12 deletions lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1652,13 +1652,13 @@ List<DartdocOption> createDartdocOptions(
help: 'Allow links to be generated for packages outside this one.',
negatable: true),
]),
// TODO(srawlins): Deprecate; with the advent of the unnamed library, this
// should be applied in each file, on the `library;` directive.
// Deprecated. Use of this option is reported.
// TODO(srawlins): Remove.
DartdocOptionFileOnly<List<String>>('nodoc', [], resourceProvider,
optionIs: OptionKind.glob,
help: 'Dart symbols declared in these files will be treated as though '
'they have the @nodoc directive added to their documentation '
'comment.'),
help: '(deprecated) Dart symbols declared in these files will be '
'treated as though they have the @nodoc directive added to their '
'documentation comment.'),
DartdocOptionArgOnly<String>('output',
resourceProvider.pathContext.join('doc', 'api'), resourceProvider,
optionIs: OptionKind.dir, help: 'Path to the output directory.'),
Expand Down Expand Up @@ -1690,13 +1690,10 @@ List<DartdocOption> createDartdocOptions(
(option.root['topLevelPackageMeta'].valueAt(dir) as PackageMeta)
.requiresFlutter) {
String? flutterRoot = option.root['flutterRoot'].valueAt(dir);
if (flutterRoot == null) {
// For now, return null. An error is reported in
// [PackageBuilder.buildPackageGraph].
return null;
}
return resourceProvider.pathContext
.join(flutterRoot, 'bin', 'cache', 'dart-sdk');
return flutterRoot == null
? null
: resourceProvider.pathContext
.join(flutterRoot, 'bin', 'cache', 'dart-sdk');
}
return packageMetaProvider.defaultSdkDir.path;
}, packageMetaProvider.resourceProvider,
Expand Down
7 changes: 7 additions & 0 deletions lib/src/model/package_graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,13 @@ class PackageGraph with CommentReferable, Nameable {
// a context is again, slow.
var globs = (config.optionSet['nodoc'].valueAt(file.parent) as List)
.cast<String>();
if (globs.isNotEmpty) {
packageGraph.defaultPackage.warn(
PackageWarning.deprecated,
message:
"The '--nodoc' option is deprecated, and will soon be removed.",
);
}
return utils.matchGlobs(globs, fullName);
});
}
Expand Down