Skip to content

Commit

Permalink
[License] Enable always_require_non_null_named_parameters
Browse files Browse the repository at this point in the history
Adds dependency on package:meta.
  • Loading branch information
cbracken committed Dec 20, 2018
1 parent f4b348f commit 233c100
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ci/licenses_golden/tool_signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Signature: 0461a8d6fe3503cd19d8e0d3becfee87
Signature: acd8a02ea76b205ea2dbea4c91961320

1 change: 1 addition & 0 deletions tools/licenses/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ analyzer:

linter:
rules:
- always_require_non_null_named_parameters
- avoid_empty_else
- avoid_function_literals_in_foreach_calls
- comment_references
Expand Down
7 changes: 6 additions & 1 deletion tools/licenses/lib/licenses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import 'dart:convert';
import 'dart:io' as system;

import 'package:meta/meta.dart';

import 'cache.dart';
import 'limits.dart';
import 'patterns.dart';
Expand Down Expand Up @@ -838,7 +840,10 @@ Iterable<_LicenseMatch> _tryReferenceByUrl(String body, MultipleVersionedLicense
}
}

Iterable<_LicenseMatch> _tryInline(String body, RegExp pattern, { bool needsCopyright, String origin }) sync* {
Iterable<_LicenseMatch> _tryInline(String body, RegExp pattern, {
@required bool needsCopyright,
String origin,
}) sync* {
assert(needsCopyright != null);
for (_PartialLicenseMatch match in _findLicenseBlocks(body, pattern, 1, 2, needsCopyright: false)) {
// We search with "needsCopyright: false" but then create a _LicenseMatch with
Expand Down
3 changes: 2 additions & 1 deletion tools/licenses/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: licenses
dependencies:
path: ^1.3.0
archive: ^2.0.4
args: 1.5.0
crypto: ^2.0.2+1
meta: ^1.1.6
path: ^1.3.0

0 comments on commit 233c100

Please sign in to comment.