Skip to content

Commit 8e6a95c

Browse files
authored
Remove the deprecated nodoc option. (#4025)
1 parent a4a902b commit 8e6a95c

File tree

9 files changed

+1
-79
lines changed

9 files changed

+1
-79
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 9.0.0-wip
22
* Remove deprecated `missingCodeBlockLanguage` warning.
33
* Remove the deprecated `templates-dir` option.
4+
* Remove the deprecated `nodoc` option.
45

56
## 8.3.4
67
* The URL for category pages now uses _category name_ instead of

lib/src/dartdoc_options.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,6 @@ class DartdocOptionContext extends DartdocOptionContextBase
12071207
// ignore: unused_element
12081208
String get _linkToHosted => optionSet['linkTo']['hosted'].valueAt(context);
12091209

1210-
List<String> get nodoc => optionSet['nodoc'].valueAt(context);
1211-
12121210
String get output => optionSet['output'].valueAt(context);
12131211

12141212
PackageMeta get packageMeta => optionSet['packageMeta'].valueAt(context);
@@ -1501,13 +1499,6 @@ List<DartdocOption> createDartdocOptions(
15011499
help: 'Allow links to be generated for packages outside this one.',
15021500
negatable: true),
15031501
]),
1504-
// Deprecated. Use of this option is reported.
1505-
// TODO(srawlins): Remove.
1506-
DartdocOptionFileOnly<List<String>>('nodoc', [], resourceProvider,
1507-
optionIs: OptionKind.glob,
1508-
help: '(deprecated) Dart symbols declared in these files will be '
1509-
'treated as though they have the @nodoc directive added to their '
1510-
'documentation comment.'),
15111502
DartdocOptionArgOnly<String>('output',
15121503
resourceProvider.pathContext.join('doc', 'api'), resourceProvider,
15131504
optionIs: OptionKind.dir, help: 'Path to the output directory.'),

lib/src/generator/templates.runtime_renderers.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25772,7 +25772,6 @@ const _invisibleGetters = {
2577225772
'linkToUrl',
2577325773
'maxFileCount',
2577425774
'maxTotalSize',
25775-
'nodoc',
2577625775
'optionSet',
2577725776
'output',
2577825777
'packageMeta',

lib/src/model/documentation_comment.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,9 @@ mixin DocumentationComment
8585
/// dartdoc's generated output.
8686
///
8787
/// An element is considered to be 'nodoc' if any of the following are true:
88-
/// * a global 'nodoc' configuration has been set for this element (this
89-
/// feature is deprecated),
9088
/// * the element has no documentation comment,
9189
/// * the documentation comment contains the `@nodoc` dartdoc directive.
9290
late final bool hasNodoc = () {
93-
if (packageGraph
94-
.configSetsNodocFor(element.library2!.firstFragment.source.fullName)) {
95-
return true;
96-
}
9791
if (!hasDocumentationComment) {
9892
return false;
9993
}

lib/src/model/package_graph.dart

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -905,38 +905,6 @@ class PackageGraph with CommentReferable, Nameable {
905905
return allElements;
906906
}
907907

908-
/// Cache of 'nodoc' configurations.
909-
///
910-
/// Glob lookups can be expensive, so cache per filename.
911-
final _configSetsNodocFor = HashMap<String, bool>();
912-
913-
/// Given an element's [fullName], look up the nodoc configuration data and
914-
/// determine whether to unconditionally treat the element as "nodoc", an
915-
/// attribute indicating that documentation should not be included in
916-
/// dartdoc's generated output.
917-
///
918-
/// This configuration setting is deprecated.
919-
bool configSetsNodocFor(String fullName) {
920-
return _configSetsNodocFor.putIfAbsent(fullName, () {
921-
var file = resourceProvider.getFile(fullName);
922-
// Direct lookup instead of generating a custom context will save some
923-
// cycles. We can't use the element's [DartdocOptionContext] because that
924-
// might not be where the element was defined, which is what's important
925-
// for nodoc's semantics. Looking up the defining element just to pull
926-
// a context is again, slow.
927-
var globs = (config.optionSet['nodoc'].valueAt(file.parent) as List)
928-
.cast<String>();
929-
if (globs.isNotEmpty) {
930-
packageGraph.defaultPackage.warn(
931-
PackageWarning.deprecated,
932-
message:
933-
"The '--nodoc' option is deprecated, and will soon be removed.",
934-
);
935-
}
936-
return utils.matchGlobs(globs, fullName);
937-
});
938-
}
939-
940908
/// Returns a macro by [name], or `null` if no macro is found.
941909
String? getMacro(String name) {
942910
assert(_localDocumentationBuilt);

test/end2end/model_test.dart

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,22 +1158,6 @@ void main() async {
11581158
});
11591159
});
11601160

1161-
group('Comment processing', () {
1162-
test('can virtually add nodoc via options file', () {
1163-
var NodocMeLibrary =
1164-
packageGraph.defaultPackage.allLibraries.named('nodocme');
1165-
expect(NodocMeLibrary.hasNodoc, isTrue);
1166-
var NodocMeImplementation =
1167-
fakeLibrary.classes.named('NodocMeImplementation');
1168-
expect(NodocMeImplementation.hasNodoc, isTrue);
1169-
expect(NodocMeImplementation.isPublic, isFalse);
1170-
var MeNeitherEvenWithoutADocComment =
1171-
fakeLibrary.classes.named('MeNeitherEvenWithoutADocComment');
1172-
expect(MeNeitherEvenWithoutADocComment.hasNodoc, isTrue);
1173-
expect(MeNeitherEvenWithoutADocComment.isPublic, isFalse);
1174-
});
1175-
});
1176-
11771161
group('doc references', () {
11781162
late final String docsAsHtml;
11791163

testing/test_package/dartdoc_options.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dartdoc:
77
Unreal:
88
markdown: "Unreal.md"
99
Real Libraries:
10-
nodoc: ["lib/src/nodoc*.dart"]
1110
tools:
1211
drill:
1312
command: ["bin/drill.dart"]

testing/test_package/lib/fake.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ import 'mylibpub.dart' as renamedLib2;
7979
import 'two_exports.dart' show BaseClass;
8080
export 'src/notadotdartfile';
8181

82-
// Verify that even though reexported, objects don't show in documentation.
83-
export 'package:test_package/src/nodocme.dart';
84-
8582
// ignore: uri_does_not_exist
8683
export 'package:test_package_imported/categoryExporting.dart'
8784
show IAmAClassWithCategories;

testing/test_package/lib/src/nodocme.dart

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)