Skip to content

Commit ec823a5

Browse files
authored
Fix a number of lints, disable a couple of lints that cannot be easily fixed (flutter#97)
1 parent d2666a1 commit ec823a5

32 files changed

+1186
-666
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: dart
22

33
dart:
4-
- 2.1.0
4+
- 2.2.0
55
- dev
66

77
dart_task:
@@ -12,7 +12,7 @@ matrix:
1212
include:
1313
- dart: dev
1414
dartanalyzer: --fatal-infos --fatal-warnings .
15-
- dart: 2.1.0
15+
- dart: 2.2.0
1616
dartanalyzer: --fatal-warnings .
1717
- dart: dev
1818
dart_task: dartfmt

analysis_options.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
include: package:pedantic/analysis_options.yaml
22

3+
analyzer:
4+
errors:
5+
always_declare_return_types: ignore # 318
6+
omit_local_variable_types: ignore # 48
7+
38
linter:
49
rules:
510
- prefer_equal_for_default_values

example/call_parser.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ const _default = css.PreprocessorOptions(
1515
/// tests (by default) will ensure that the CSS is really valid.
1616
StyleSheet parseCss(String cssInput,
1717
{List<css.Message> errors, css.PreprocessorOptions opts}) {
18-
return css.parse(cssInput,
19-
errors: errors, options: opts == null ? _default : opts);
18+
return css.parse(cssInput, errors: errors, options: opts ?? _default);
2019
}
2120

2221
// Pretty printer for CSS.
2322
var emitCss = CssPrinter();
2423
String prettyPrint(StyleSheet ss) =>
2524
(emitCss..visitTree(ss, pretty: true)).toString();
2625

27-
main() {
26+
void main() {
2827
var errors = <css.Message>[];
2928

3029
// Parse a simple stylesheet.
@@ -42,7 +41,7 @@ main() {
4241
errors: errors);
4342

4443
if (errors.isNotEmpty) {
45-
print("Got ${errors.length} errors.\n");
44+
print('Got ${errors.length} errors.\n');
4645
for (var error in errors) {
4746
print(error);
4847
}
@@ -60,7 +59,7 @@ main() {
6059
errors: errors);
6160

6261
if (errors.isNotEmpty) {
63-
print("Got ${errors.length} errors.\n");
62+
print('Got ${errors.length} errors.\n');
6463
for (var error in errors) {
6564
print(error);
6665
}
@@ -74,7 +73,7 @@ main() {
7473
stylesheetError = parseCss('# div1 { color: red; }', errors: errors);
7574

7675
if (errors.isNotEmpty) {
77-
print("Detected ${errors.length} problem in checked mode.\n");
76+
print('Detected ${errors.length} problem in checked mode.\n');
7877
for (var error in errors) {
7978
print(error);
8079
}
@@ -87,7 +86,7 @@ main() {
8786
print(' ======================');
8887
var selectorAst = css.selector('#div .foo', errors: errors);
8988
if (errors.isNotEmpty) {
90-
print("Got ${errors.length} errors.\n");
89+
print('Got ${errors.length} errors.\n');
9190
for (var error in errors) {
9291
print(error);
9392
}

0 commit comments

Comments
 (0)