Skip to content

Add type as parameter lint and fix problems #2195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linter:
- always_declare_return_types
- annotate_overrides
- avoid_init_to_null
- avoid_types_as_parameter_names
- directives_ordering
- no_adjacent_strings_in_list
- package_api_docs
Expand Down
2 changes: 1 addition & 1 deletion lib/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class Dartdoc extends PackageBuilder {
Uri uri;
try {
uri = Uri.parse(href);
} catch (FormatError) {
} on FormatException {
// ignore
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/package_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class PackageWithoutSdkResolver extends UriResolver {
Uri resolved;
try {
resolved = _sdkResolver.restoreAbsolute(source);
} catch (ArgumentError) {
} on ArgumentError {
// SDK resolvers really don't like being thrown package paths.
}
if (resolved == null) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev_dependencies:
io: ^0.3.0
http: ^0.12.0
meta: ^1.0.0
pedantic: ^1.8.0
pedantic: ^1.9.0
test: ^1.3.0

executables:
Expand Down
7 changes: 5 additions & 2 deletions test/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,11 @@ class SubprocessLauncher {
Map result;
try {
result = json.decoder.convert(line);
} catch (FormatException) {
// ignore
} on FormatException {
// Assume invalid JSON is actually a line of normal text.
} on TypeError {
// The convert function returns a String if there is no JSON in the
// line. Just ignore it and leave result null.
}
if (result != null) {
if (jsonObjects == null) {
Expand Down