Skip to content

Commit 9347c1a

Browse files
committed
Merge pull request #1156 from keertip/nodoc
add support for @noddoc tag
2 parents f2b68c0 + 89f760c commit 9347c1a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/src/model_utils.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool isPrivate(Element e) =>
5555
bool isPublic(Element e) {
5656
if (isPrivate(e)) return false;
5757
// check to see if element is part of the public api, that is it does not
58-
// have a '#nodoc' in the documentation comment
58+
// have a '<nodoc>' or '@nodoc' in the documentation comment
5959
if (e is PropertyAccessorElement && e.isSynthetic) {
6060
var accessor = (e as PropertyAccessorElement);
6161
if (accessor.correspondingSetter != null &&
@@ -70,7 +70,9 @@ bool isPublic(Element e) {
7070
}
7171

7272
var docComment = e.documentationComment;
73-
if (docComment != null && docComment.contains('<nodoc>')) return false;
73+
if (docComment != null &&
74+
(docComment.contains('<nodoc>') || docComment.contains('@nodoc')))
75+
return false;
7476
return true;
7577
}
7678

testing/test_package/lib/example.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ class unDocumented {
263263
String s;
264264
}
265265

266+
/// @nodoc
267+
class unDocumented2 {
268+
String s;
269+
}
270+
266271
abstract class _PrivateAbstractClass {
267272
void test() {
268273
print("Hello World");

0 commit comments

Comments
 (0)