Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 8 additions & 0 deletions lib/src/model/documentation_comment.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:io';

import 'package:analyzer/dart/element/element.dart';
import 'package:args/args.dart';
import 'package:crypto/crypto.dart' as crypto;
Expand Down Expand Up @@ -676,6 +682,8 @@ mixin DocumentationComment
for (var element in firstOfPair) {
final result = element.group(2)!.trim();
if (result.isEmpty) {
stderr.writeln("The warning 'missingCodeBlockLanguage' is deprecated. "
'Use the `missing_code_block_language_in_doc_comment` lint instead.');
warn(PackageWarning.missingCodeBlockLanguage,
message:
'A fenced code block in Markdown should have a language specified');
Expand Down
14 changes: 8 additions & 6 deletions lib/src/warnings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,17 @@ enum PackageWarning implements Comparable<PackageWarning> {
'deprecated dartdoc usage: {0}',
shortHelp: 'A dartdoc directive has a deprecated format.',
),
// TODO(kallentu): Remove this warning.
missingCodeBlockLanguage(
'missing-code-block-language',
'missing code block language: {0}',
shortHelp: 'A fenced code block is missing a specified language.',
longHelp:
'To enable proper syntax highlighting of Markdown code blocks, Dartdoc '
'requires code blocks to specify the language used after the initial '
'declaration. As an example, to specify Dart you would open the '
'Markdown code block with ```dart or ~~~dart.',
shortHelp: '(Deprecated: Use `missing_code_block_language_in_doc_comment` '
'lint) A fenced code block is missing a specified language.',
longHelp: '(Deprecated: Use `missing_code_block_language_in_doc_comment` '
'lint) To enable proper syntax highlighting of Markdown code blocks, '
'Dartdoc requires code blocks to specify the language used after the '
'initial declaration. As an example, to specify Dart you would open '
'the Markdown code block with ```dart or ~~~dart.',
defaultWarningMode: PackageWarningMode.ignore,
);

Expand Down