Skip to content

Commit e1bd212

Browse files
committed
Merge branch 'master' into nnbd-non-migration-second
2 parents 77ca218 + 2e3f4bf commit e1bd212

24 files changed

+237
-178
lines changed

analysis_options.yaml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,39 @@ linter:
2121
- avoid_unused_constructor_parameters
2222
- annotate_overrides
2323
- avoid_init_to_null
24-
- avoid_types_as_parameter_names
25-
- camel_case_types
2624
- directives_ordering
27-
- iterable_contains_unrelated_type
28-
- list_remove_unrelated_type
2925
- no_adjacent_strings_in_list
3026
- package_api_docs
3127
- prefer_final_fields
32-
- prefer_generic_function_type_aliases
3328
- prefer_initializing_formals
3429
- prefer_void_to_null
35-
- provide_deprecation_message
3630
- slash_for_doc_comments
3731
- type_annotate_public_apis
38-
- unawaited_futures
3932
# - unnecessary_brace_in_string_interps
33+
# Work in progress canonical score lints
34+
- avoid_empty_else
35+
- avoid_relative_lib_imports
36+
- avoid_shadowing_type_parameters
37+
- await_only_futures
38+
- camel_case_extensions
39+
- camel_case_types
40+
- curly_braces_in_flow_control_structures
41+
- empty_catches
42+
- file_names
43+
- hash_and_equals
44+
- iterable_contains_unrelated_type
45+
- list_remove_unrelated_type
46+
- no_duplicate_case_values
47+
# - non_constant_identifier_names
48+
- package_prefixed_library_names
49+
- prefer_generic_function_type_aliases
50+
- prefer_is_empty
51+
- prefer_is_not_empty
52+
- prefer_iterable_whereType
53+
- prefer_typing_uninitialized_variables
54+
- provide_deprecation_message
55+
- unawaited_futures
4056
- unnecessary_overrides
57+
- unrelated_type_equality_checks
58+
- valid_regexps
4159
- void_checks

analysis_options_presubmit.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,43 @@ analyzer:
2020
linter:
2121
rules:
2222
- always_declare_return_types
23+
- avoid_single_cascade_in_expression_statements
24+
- avoid_unused_constructor_parameters
2325
- annotate_overrides
2426
- avoid_init_to_null
25-
- avoid_types_as_parameter_names
2627
- directives_ordering
2728
- no_adjacent_strings_in_list
2829
- package_api_docs
2930
- prefer_final_fields
30-
- prefer_generic_function_type_aliases
31+
- prefer_initializing_formals
32+
- prefer_void_to_null
3133
- slash_for_doc_comments
3234
- type_annotate_public_apis
35+
# - unnecessary_brace_in_string_interps
36+
# Work in progress canonical score lints
37+
- avoid_empty_else
38+
- avoid_relative_lib_imports
39+
- avoid_shadowing_type_parameters
40+
- await_only_futures
41+
- camel_case_extensions
42+
- camel_case_types
43+
- curly_braces_in_flow_control_structures
44+
- empty_catches
45+
- file_names
46+
- hash_and_equals
47+
- iterable_contains_unrelated_type
48+
- list_remove_unrelated_type
49+
- no_duplicate_case_values
50+
# - non_constant_identifier_names
51+
- package_prefixed_library_names
52+
- prefer_generic_function_type_aliases
53+
- prefer_is_empty
54+
- prefer_is_not_empty
55+
- prefer_iterable_whereType
56+
- prefer_typing_uninitialized_variables
57+
- provide_deprecation_message
3358
- unawaited_futures
34-
# - unnecessary_brace_in_string_interps
59+
- unnecessary_overrides
60+
- unrelated_type_equality_checks
61+
- valid_regexps
62+
- void_checks

lib/dartdoc.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ class Dartdoc {
392392
}
393393
}
394394
// Missing from search index
395-
var missing_from_search = visited.difference(found);
396-
for (var s in missing_from_search) {
395+
var missingFromSearch = visited.difference(found);
396+
for (var s in missingFromSearch) {
397397
_warn(packageGraph, PackageWarning.missingFromSearchIndex, s,
398398
path.normalize(origin),
399399
referredFrom: fullPath);

lib/src/dartdoc_options.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ class ToolConfiguration {
335335
for (var entry in yamlMap.entries) {
336336
var name = entry.key.toString();
337337
var toolMap = entry.value;
338-
var description;
338+
String description;
339339
List<String> command;
340340
List<String> setupCommand;
341341
if (toolMap is Map) {
@@ -1130,7 +1130,7 @@ abstract class _DartdocFileOption<T> implements DartdocOption<T> {
11301130
yamlData = yamlData[key] ?? {};
11311131
}
11321132

1133-
var returnData;
1133+
dynamic returnData;
11341134
if (_isListString) {
11351135
if (yamlData is YamlList) {
11361136
returnData = <String>[];

lib/src/generator/dartdoc_generator_backend.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ abstract class DartdocGeneratorBackend implements GeneratorBackend {
7777
TemplateData data) {
7878
var content = template.renderString(data);
7979
if (!options.useBaseHref) {
80-
content = content.replaceAll(HTMLBASE_PLACEHOLDER, data.htmlBase);
80+
content = content.replaceAll(htmlBasePlaceholder, data.htmlBase);
8181
}
8282
writer.write(filename, content,
8383
element: data.self is Warnable ? data.self : null);
@@ -89,7 +89,7 @@ abstract class DartdocGeneratorBackend implements GeneratorBackend {
8989
var json = generator_util.generateCategoryJson(
9090
categories, options.prettyIndexJson);
9191
if (!options.useBaseHref) {
92-
json = json.replaceAll(HTMLBASE_PLACEHOLDER, '');
92+
json = json.replaceAll(htmlBasePlaceholder, '');
9393
}
9494
writer.write(_pathContext.join('categories.json'), '${json}\n');
9595
}
@@ -99,7 +99,7 @@ abstract class DartdocGeneratorBackend implements GeneratorBackend {
9999
var json = generator_util.generateSearchIndexJson(
100100
indexedElements, options.prettyIndexJson);
101101
if (!options.useBaseHref) {
102-
json = json.replaceAll(HTMLBASE_PLACEHOLDER, '');
102+
json = json.replaceAll(htmlBasePlaceholder, '');
103103
}
104104
writer.write(_pathContext.join('index.json'), '${json}\n');
105105
}
@@ -228,5 +228,6 @@ abstract class DartdocGeneratorBackend implements GeneratorBackend {
228228
}
229229

230230
@override
231-
void generateAdditionalFiles(FileWriter writer, PackageGraph graph) {}
231+
Future<void> generateAdditionalFiles(
232+
FileWriter writer, PackageGraph graph) async {}
232233
}

lib/src/generator/generator_frontend.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,5 +329,5 @@ abstract class GeneratorBackend {
329329
FileWriter writer, PackageGraph graph, Library library, Typedef typedef);
330330

331331
/// Emit files not specific to a Dart language element.
332-
void generateAdditionalFiles(FileWriter writer, PackageGraph graph);
332+
Future<void> generateAdditionalFiles(FileWriter writer, PackageGraph graph);
333333
}

lib/src/generator/html_generator.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class HtmlGeneratorBackend extends DartdocGeneratorBackend {
3838
}
3939

4040
@override
41-
void generateAdditionalFiles(FileWriter writer, PackageGraph graph) async {
41+
Future<void> generateAdditionalFiles(
42+
FileWriter writer, PackageGraph graph) async {
4243
await _copyResources(writer);
4344
if (options.favicon != null) {
4445
// Allow overwrite of favicon.

lib/src/generator/template_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ abstract class TemplateData<T extends Documentable> {
4646

4747
String get bareHref {
4848
if (self is Indexable) {
49-
return (self as Indexable).href.replaceAll(HTMLBASE_PLACEHOLDER, '');
49+
return (self as Indexable).href.replaceAll(htmlBasePlaceholder, '');
5050
}
5151
return '';
5252
}

lib/src/generator/templates.renderers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// To change the contents of this library, make changes to the builder source
44
// files in the tool/mustachio/ directory.
55

6-
// ignore_for_file: camel_case_types, unnecessary_cast, unused_element, unused_import
6+
// ignore_for_file: camel_case_types, unnecessary_cast, unused_element, unused_import, non_constant_identifier_names
77
import 'package:analyzer/file_system/file_system.dart';
88
import 'package:dartdoc/src/generator/template_data.dart';
99
import 'package:dartdoc/dartdoc.dart';

lib/src/markdown_processor.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,23 @@ final RegExp operatorPrefix = RegExp(r'^operator[ ]*');
163163

164164
final HtmlEscape htmlEscape = const HtmlEscape(HtmlEscapeMode.element);
165165

166-
final List<md.InlineSyntax> _markdown_syntaxes = [
166+
final List<md.InlineSyntax> _markdownSyntaxes = [
167167
_InlineCodeSyntax(),
168168
_AutolinkWithoutScheme(),
169169
md.InlineHtmlSyntax(),
170170
md.StrikethroughSyntax(),
171171
md.AutolinkExtensionSyntax(),
172172
];
173173

174-
final List<md.BlockSyntax> _markdown_block_syntaxes = [
174+
final List<md.BlockSyntax> _markdownBlockSyntaxes = [
175175
const md.FencedCodeBlockSyntax(),
176176
const md.HeaderWithIdSyntax(),
177177
const md.SetextHeaderWithIdSyntax(),
178178
const md.TableSyntax(),
179179
];
180180

181181
// Remove these schemas from the display text for hyperlinks.
182-
final RegExp _hide_schemes = RegExp('^(http|https)://');
182+
final RegExp _hideSchemes = RegExp('^(http|https)://');
183183

184184
class MatchingLinkResult {
185185
final ModelElement element;
@@ -951,8 +951,8 @@ class MarkdownDocument extends md.Document {
951951
}
952952

953953
return MarkdownDocument(
954-
inlineSyntaxes: _markdown_syntaxes,
955-
blockSyntaxes: _markdown_block_syntaxes,
954+
inlineSyntaxes: _markdownSyntaxes,
955+
blockSyntaxes: _markdownBlockSyntaxes,
956956
linkResolver: linkResolver);
957957
}
958958

@@ -1020,7 +1020,7 @@ class _AutolinkWithoutScheme extends md.AutolinkSyntax {
10201020
@override
10211021
bool onMatch(md.InlineParser parser, Match match) {
10221022
var url = match[1];
1023-
var text = htmlEscape.convert(url).replaceFirst(_hide_schemes, '');
1023+
var text = htmlEscape.convert(url).replaceFirst(_hideSchemes, '');
10241024
var anchor = md.Element.text('a', text);
10251025
anchor.attributes['href'] = url;
10261026
parser.addNode(anchor);

0 commit comments

Comments
 (0)